mod sampler

module sampler

HmcSaSampler: HMC inside SA, generic over the momentum kernel.

Gaussian and q-Gaussian momentum drive the same Sampler<f64> impl through the Momentum trait. Fixed-step integrators are likewise pluggable, so leapfrog and Omelyan maps share the sampler surface.

Structs and Unions

struct HmcSaSampler<O, G, C, M, I>
where
    O: Objective<f64> + Send + Sync,
    G: Gradient<f64>,
    C: Cooling<f64>,
    M: Momentum,
    I: HmcIntegrator

HMC-driven SA sampler with pluggable momentum kernel.

M = GaussianMomentum recovers Phase 1 standard HMC. M = QGaussianMomentum enables the q-deformed dynamics: heavy-tailed momentum draws let the chain escape local cups at the cost of less efficient exploitation in smooth regions.

obj: O

The objective.

gradient: G

The gradient (analytic or finite-difference).

cool: C

The cooling schedule.

momentum: M

The momentum kernel (Gaussian, q-Gaussian, or custom).

integrator: I

The fixed-step HMC integrator (epsilon, L, temp_ref).

initial_pos: Option<Array1<f64>>

Optional deterministic starting position.

Implementations

impl<O, G, C, I> HmcSaSampler<O, G, C, GaussianMomentum, I>
where
    O: Objective<f64> + Send + Sync,
    G: Gradient<f64>,
    C: Cooling<f64>,
    I: HmcIntegrator

Functions

fn new(obj: O, gradient: G, cool: C, integrator: I) -> Self

Constructs an HMC-SA sampler with standard Gaussian momentum. Equivalent to HmcSaSampler::with_momentum with GaussianMomentum.

impl<O, G, C, M, I> HmcSaSampler<O, G, C, M, I>
where
    O: Objective<f64> + Send + Sync,
    G: Gradient<f64>,
    C: Cooling<f64>,
    M: Momentum,
    I: HmcIntegrator

Functions

fn with_initial_pos(mut self, pos: Array1<f64>) -> Self

Returns a sampler that starts from the supplied position.

fn with_momentum(obj: O, gradient: G, cool: C, momentum: M, integrator: I) -> Self

Constructs with a user-chosen momentum kernel.

Traits implemented

impl<O, G, C, M, I> Sampler<f64> for HmcSaSampler<O, G, C, M, I>
where
    O: Objective<f64> + Send + Sync,
    G: Gradient<f64>,
    C: Cooling<f64>,
    M: Momentum,
    I: HmcIntegrator