MCMC Configurations¶
Internal API reference for MCMC configuration dataclasses used by inference dispatchers and backend integrations.
AdaptiveMetropolisConfig
dataclass
¶
Bases: BaseMCMCConfig
Adaptive random-walk Metropolis-within-Gibbs configuration.
One transition updates each flattened unconstrained coordinate in order. Each coordinate update uses a one-dimensional Gaussian random-walk proposal that is accepted or rejected before the next coordinate is visited; the sampler does not make a single joint multivariate-normal proposal. Proposal scales adapt during warmup toward the requested acceptance rate and remain fixed while retained samples are generated.
This sampler is currently implemented by the BlackJAX integration only.
Attributes:
| Name | Type | Description |
|---|---|---|
initial_proposal_scale |
ArrayLike
|
Positive scalar proposal scale, or one positive scale per flattened unconstrained coordinate. |
target_acceptance_rate |
float
|
Shared target acceptance rate applied to each coordinate update. |
adaptation_rate |
float
|
Exponent in the diminishing adaptation step
|
max_adaptation |
float
|
Maximum change to a log proposal scale in one warmup transition. |
AdjustedMCLMCDynamicConfig
dataclass
¶
Bases: BaseMCMCConfig
Dynamic adjusted MCLMC (MHMCHMC) configuration.
This maps to blackjax.adjusted_mclmc_dynamic(...) and uses its
top-level API arguments.
Attributes:
| Name | Type | Description |
|---|---|---|
step_size |
float
|
Integrator step size. |
L_proposal_factor |
float
|
Proposal length scaling factor. |
divergence_threshold |
float
|
Energy-difference threshold used to flag divergences. |
integration_steps_min |
int
|
Minimum random integration steps per proposal. |
integration_steps_max |
int
|
Exclusive upper bound for random integration steps per proposal. |
BaseMCMCConfig
dataclass
¶
Shared configuration options inherited by all MCMC configs.
You do not instantiate this class directly; use one of the concrete
subclasses (NUTSConfig, HMCConfig, AdaptiveMetropolisConfig,
SGLDConfig, MALAConfig, AdjustedMCLMCDynamicConfig).
Attributes:
| Name | Type | Description |
|---|---|---|
num_samples |
int
|
Number of post-warmup samples to return. |
num_warmup |
int
|
Number of warmup/burn-in transitions. |
num_chains |
int
|
Number of Markov chains to run in parallel. |
mcmc_source |
MCMCSource
|
Backend library used for inference.
Supported values are |
init_strategy |
callable
|
NumPyro initialization strategy used when constructing unconstrained initial parameters. |
HMCConfig
dataclass
¶
Bases: BaseMCMCConfig
Hamiltonian Monte Carlo (HMC) configuration.
Attributes:
| Name | Type | Description |
|---|---|---|
step_size |
float
|
Integrator step size used by the leapfrog solver.
Ignored when |
num_steps |
int
|
Number of leapfrog steps per HMC proposal. |
adapt |
bool
|
Whether to tune step size and mass matrix during warmup.
Defaults to |
MALAConfig
dataclass
¶
Bases: BaseMCMCConfig
Metropolis-Adjusted Langevin Algorithm (MALA) configuration.
Attributes:
| Name | Type | Description |
|---|---|---|
step_size |
float
|
Proposal step size used by |
NUTSConfig
dataclass
¶
Bases: BaseMCMCConfig
No-U-Turn Sampler (NUTS) configuration.
Attributes:
| Name | Type | Description |
|---|---|---|
target_acceptance_rate |
float
|
Target acceptance probability used during warmup. Must lie strictly between zero and one. |
SGLDConfig
dataclass
¶
Bases: BaseMCMCConfig
Stochastic Gradient Langevin Dynamics (SGLD) configuration.
SGLD performs first-order Langevin updates using noisy gradients and injected Gaussian noise. In this implementation, gradients are computed on the full dataset (no minibatching), so the method behaves as full-batch Langevin dynamics with an annealed step schedule.
Attributes:
| Name | Type | Description |
|---|---|---|
step_size |
float
|
Base learning rate used in the SGLD schedule. This should generally be small. |
schedule_power |
float
|
Power in the polynomial decay schedule
\(\epsilon_t = \text{step_size} \cdot t^{-\text{schedule_power}}\).
Values in |