Learn Configuration¶
Source code:
bff/workflows/learn/config.pybff/workflows/learn/main.pybff/bayes/learning.py
Purpose¶
bff learn runs posterior learning from previously trained surrogate models.
The reference observation vectors are read from the surrogate files themselves.
Effective observation counts are assigned when the models are loaded for
learning.
Minimal Example¶
log: ./out.log
specs: ../03-sample/specs.yaml
models:
rdf:
model_path: ../05-fit/models/rdf.lgp
tolerance: 0.1
density:
model_path: ../05-fit/models/density.lgp
independent_observations: true
pmf:
model_path: ../05-fit/models/pmf.lgp
n_eff: 5
mcmc:
total_steps: 10000
warmup: 2000
checkpoint: ./mcmc-checkpoint.pt
posterior: ./posterior.pt
priors: ./priors.pt
restart: false
device: cuda
Top-Level Keys¶
logWorkflow log file.specsForce-field specification file from the sample stage.modelsNon-empty mapping from QoI name to trained.lgpmodel settings.mcmcPosterior-sampling settings.
models Keys¶
Each key under models is the QoI name that should appear in logs and plots.
Each value is a mapping with:
model_pathPath to the corresponding trained.lgpfile.independent_observationsIftrue, every reference value counts as one effective observation.n_effPositive effective observation count to use directly. It cannot be combined withindependent_observationsortolerance.toleranceRequired when neitherindependent_observations: truenorn_effis specified. The reference values are split into their stored curves and the effective count is estimated from each curve.
The Gaussian contribution for one QoI uses the mean squared curve residual:
-0.5 * n_eff * MSE / sigma^2 - n_eff * log(sigma)
Using MSE keeps the likelihood insensitive to merely duplicating or refining
the curve bins. n_eff controls how many independently resolved observations
the complete curve represents.
Warning
BFF 0.3.0 removes the path-only model syntax and cannot load pre-0.3.0
.lgp files. Refit the surrogate models and use the nested model mappings
shown above.
mcmc Keys¶
priors_disttypePrior family, currently defaulting tonormal.total_stepsTotal MCMC steps.warmupBurn-in length.thinChain thinning factor.progress_strideLogging interval.n_walkersOptional walker count. If omitted, BFF chooses a default.checkpointCheckpoint file path.posteriorPosterior chain output path.priorsPrior output path.restartRestart from checkpoint if possible.deviceTorch device for MCMC.rhat_tolR-hat convergence threshold.ess_minMinimum effective sample size target.include_implicit_chargeIftrue, include reconstructed implicit charges in prepared posterior samples.
Plots¶
bff learn writes:
marginals.pdfPrior and posterior parameter marginals.qoi-marginals.pdfPosterior marginals partitioned into contrastive QoI-attribution colors. The colored regions are diagnostic responsibilities, not an additive decomposition of posterior probability. The first legend row identifies the prior, total posterior, and parameter bounds; the second identifies QoIs.corner.pdfJoint posterior parameter and nuisance distributions.