Search and sampling configuration¶
These objects are imported from multimodalsrm.bayesian. SearchConfig controls MAP optimization; SamplerConfig controls NUTS sampling. BayesianProblem and ParameterSubspace are advanced, lower-level interfaces. See configuration choices before changing budgets or conditional targets.
Generated from the checked-out source
Signatures, field defaults, and available docstrings below are generated by scripts/build_api_reference.py. Constructor defaults are not a recommendation for every analysis. Semantic choices are explained in the API guide.
SearchConfig¶
from multimodalsrm.bayesian import SearchConfig · Source
SearchConfig(
starts=16,
maxiter=1200,
ftol=1e-12,
gtol=1e-06,
physical_gradient_tolerance=0.001,
refine_maxiter=0,
polish_max_parameters=256,
n_jobs=1,
conditioning="none",
r_init=False,
)
| Field | Type | Default |
|---|---|---|
starts |
int |
16 |
maxiter |
int |
1200 |
ftol |
float |
1e-12 |
gtol |
float |
1e-06 |
physical_gradient_tolerance |
float |
0.001 |
refine_maxiter |
int |
0 |
polish_max_parameters |
int |
256 |
n_jobs |
int |
1 |
conditioning |
str |
"none" |
r_init |
bool |
False |
MAP budgets; n_jobs runs independent restarts in shared-memory threads.
The default is serial. Set BLAS/XLA thread settings before starting Python;
search never changes process-global thread limits. Refinement is serial.
Optional diagonal conditioning uses staged physical coordinates for full
multifactor dense/grouped fits with independent noise; the default is none.
r_init=True seeds the first full-training MAP restart from a bounded
CPU R-MSRM fit. Other prior-quantile starts and the GP target are unchanged.
It is opt-in: the default is the historical data-based first start. The
measured benefit is scale-dependent and has not been shown to transfer to
empirical recordings, so enabling it is a per-analysis decision.
SamplerConfig¶
from multimodalsrm.bayesian import SamplerConfig · Source
SamplerConfig(
chains=4,
warmup=1000,
draws=1200,
target_accept=0.99,
max_tree_depth=10,
chain_method="sequential",
start_objective_window=5.0,
start_jitter=0.08,
mass_matrix="dense",
max_dense_parameters=1024,
orientation_refresh="none",
)
| Field | Type | Default |
|---|---|---|
chains |
int |
4 |
warmup |
int |
1000 |
draws |
int |
1200 |
target_accept |
float |
0.99 |
max_tree_depth |
int |
10 |
chain_method |
str |
"sequential" |
start_objective_window |
float |
5.0 |
start_jitter |
float |
0.08 |
mass_matrix |
str |
"dense" |
max_dense_parameters |
int |
1024 |
orientation_refresh |
str |
"none" |
NUTS settings; optional Haar refresh supports full multifactor targets.
orientation_refresh='haar' refreshes common rotations and reflections
after retained transitions. Warmup and the default 'none' are unchanged.
Supports dense/grouped Identity/Gaussian or quadrature Gamma/DoubleGamma/BatemanSCR
targets with all parameters active and isotropic unbounded Gaussian
loading priors.
SpectralConfig¶
from multimodalsrm.bayesian import SpectralConfig · Source
SpectralConfig(rank, padding)
| Field | Type | Default |
|---|---|---|
rank |
int |
required |
padding |
float |
required |
Explicit basis rank and padding (seconds on each side of each run).
Rank/padding require numerical and posterior validation for each use. Increasing padding without increasing rank lowers the frequency cutoff.
ParameterSubspace¶
from multimodalsrm.bayesian import ParameterSubspace · Source
ParameterSubspace(problem, reference, *, blocks=None)
Sample selected blocks conditional on all remaining physical values.
The reference is copied and immutable. Only active coordinates are transformed, so fixed boundary values remain exact and contribute no transform Jacobian. The full physical density supplies the conditional posterior up to a constant.
ParameterSubspace.from_unconstrained¶
ParameterSubspace.from_unconstrained(z)
ParameterSubspace.to_unconstrained¶
ParameterSubspace.to_unconstrained(x)
ParameterSubspace.potential¶
ParameterSubspace.potential(z)
BayesianProblem¶
from multimodalsrm.bayesian import BayesianProblem · Source
BayesianProblem(
adapter,
priors,
*,
anchor=None,
reference_modality=None,
systems=None,
linear_algebra="dense",
spectral=None,
run_baseline_sd=None,
noise_timescales=None,
response_quadrature_order=None,
state_space_gaussian="auto",
conventions_from=None,
length_scale_prior=None,
)
Prepared native observations with a shared GP timescale.
Names are tuples: (loading/offset, subject, modality, feature), (noise, subject, modality), (filter, modality, parameter), or an optional (gp, length_scale) shared by all factors and runs. All vectors, including posterior draws, use physical parameter units.
BayesianProblem.gp_length_scale¶
BayesianProblem.gp_length_scale(x)
Physical timescale for this draw, or the original fixed value.
BayesianProblem.arrays¶
BayesianProblem.arrays(x)
BayesianProblem.covariance¶
BayesianProblem.covariance(x, run, *, include_noise=True)
BayesianProblem.temporal_covariance¶
BayesianProblem.temporal_covariance(x, times_a, modalities_a, times_b, modalities_b)
Shared temporal block; modality -1 denotes the unfiltered latent.
BayesianProblem.nll¶
BayesianProblem.nll(x)
BayesianProblem.log_prior¶
BayesianProblem.log_prior(x)
BayesianProblem.objective¶
BayesianProblem.objective(x)
BayesianProblem.value_gradient¶
BayesianProblem.value_gradient(x)
BayesianProblem.from_unconstrained¶
BayesianProblem.from_unconstrained(z)
BayesianProblem.to_unconstrained¶
BayesianProblem.to_unconstrained(x)
BayesianProblem.potential¶
BayesianProblem.potential(z)