Skip to main content

FlowMclmcSettings

Type Alias FlowMclmcSettings 

Source
pub type FlowMclmcSettings = MclmcSettings<FlowSettings>;
Expand description

MCLMC settings with a learned flow transformation.

⚠️ Experimental — use with caution: Highly experimental. Correctness of the returned posteriors has not been verified. May change at any time.

Aliased Type§

pub struct FlowMclmcSettings {
Show 16 fields pub step_size: f64, pub momentum_decoherence_length: f64, pub num_tune: u64, pub num_draws: u64, pub num_chains: usize, pub seed: u64, pub max_energy_error: f64, pub store_unconstrained: bool, pub store_gradient: bool, pub store_transformed: bool, pub store_divergences: bool, pub adapt_options: FlowSettings, pub subsample_frequency: f64, pub dynamic_step_size: bool, pub trajectory_kind: MclmcTrajectoryKind, pub trajectory_switch_fraction: f64,
}

Fields§

§step_size: f64

Step size ε for the ESH leapfrog integrator.

§momentum_decoherence_length: f64

Momentum decoherence length L (controls partial momentum refresh rate). Set to f64::INFINITY to disable momentum refresh entirely.

§num_tune: u64

Number of warmup draws.

§num_draws: u64

Number of sampling draws after warmup.

§num_chains: usize

Number of parallel chains.

§seed: u64

RNG seed.

§max_energy_error: f64

Maximum energy error before a step is flagged as a divergence.

§store_unconstrained: bool

Store each unconstrained parameter vector in the sampler stats.

§store_gradient: bool

Store the gradient in the sampler stats.

§store_transformed: bool

Store the transformed gradient and value in the sampler stats

§store_divergences: bool

Store detailed information about each divergence in the sampler stats

§adapt_options: FlowSettings

Geometry adaptation options (step-size fields are ignored for Euclidean settings).

§subsample_frequency: f64

Number of leapfrog steps per draw as a fraction of L / ε.

The number of leapfrog steps between collector calls is: round(subsample_frequency * L / ε).max(1)

  • 1.0 (default) — one sample per full trajectory (at the final step).
  • 0.0 — every leapfrog step.
  • Values in between space samples as a fraction of the decoherence length, so the interval scales naturally when L or ε changes.
§dynamic_step_size: bool

When true, use the tree-structured step size retry on divergence: halve the step size factor and try 2 steps before doubling back. log_weight will include log(step_size) to correct for the varying sampling density. When false, divergences are recorded immediately without any retry and log_weight = -energy_change.

§trajectory_kind: MclmcTrajectoryKind

Selects which leapfrog integrator and partial-momentum-refresh style to use. See MclmcTrajectoryKind for the available options. Default: MclmcTrajectoryKind::Microcanonical (original MCLMC).

§trajectory_switch_fraction: f64

Fraction of num_tune draws at which the trajectory is switched from Euclidean to Microcanonical when trajectory_kind == MclmcTrajectoryKind::EuclideanEarlyThenMicrocanonical. Ignored for other trajectory kinds. Default: 0.3.

Trait Implementations§

Source§

impl Default for FlowMclmcSettings

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Settings for FlowMclmcSettings

Source§

type Chain<M: Math> = MclmcChain<M, ChaCha8Rng, ExternalTransformAdaptation, ExternalTransformation<M>>

Source§

fn new_chain<M: Math, R: Rng + ?Sized>( &self, chain: u64, math: M, rng: &mut R, ) -> Self::Chain<M>

Source§

fn hint_num_tune(&self) -> usize

Source§

fn hint_num_draws(&self) -> usize

Source§

fn num_chains(&self) -> usize

Source§

fn seed(&self) -> u64

Source§

fn stats_options<M: Math>( &self, ) -> <Self::Chain<M> as SamplerStats<M>>::StatsOptions

Source§

fn sampler_name(&self) -> &'static str

Source§

fn adaptation_name(&self) -> &'static str

Source§

fn stat_names<M: Math>(&self, math: &M) -> Vec<String>

Source§

fn data_names<M: Math>(&self, math: &M) -> Vec<String>

Source§

fn stat_types<M: Math>(&self, math: &M) -> Vec<(String, ItemType)>

Source§

fn stat_type<M: Math>(&self, math: &M, name: &str) -> ItemType

Source§

fn data_types<M: Math>(&self, math: &M) -> Vec<(String, ItemType)>

Source§

fn data_type<M: Math>(&self, math: &M, name: &str) -> ItemType

Source§

fn stat_dims_all<M: Math>(&self, math: &M) -> Vec<(String, Vec<String>)>

Source§

fn stat_dims<M: Math>(&self, math: &M, name: &str) -> Vec<String>

Source§

fn stat_dim_sizes<M: Math>(&self, math: &M) -> HashMap<String, u64>

Source§

fn data_dims_all<M: Math>(&self, math: &M) -> Vec<(String, Vec<String>)>

Source§

fn data_dims<M: Math>(&self, math: &M, name: &str) -> Vec<String>

Source§

fn stat_coords<M: Math>(&self, math: &M) -> HashMap<String, Value>

Source§

fn stat_event_dims<M: Math>(&self, math: &M) -> Vec<(String, Option<String>)>