Executable tutorials¶
Run python scripts/execute_notebooks.py --device cpu from an environment with pip install -e '.[notebooks]'. Each notebook starts a clean kernel using the current Python executable, prints software/device/dtype/seed information, and writes its real outputs. Results are deterministic only within a compatible hardware/software stack. Notebook defaults use float64 and one CPU thread; LAFA_DEVICE selects the device and LAFA_QUICK=0 increases budgets. The runner exposes these as --device and --full.
| Notebook | Experiment and independent reference | Interpretation |
|---|---|---|
| 01 Overdamped | Correlated Gaussian moments and analytic ULA invariant covariance, followed by mixture and banana samples; independent-chain Rhat, bulk/tail ESS and mean/quantile MCSE | MH correction, finite-step bias, acceptance and adaptation are separate properties. Frozen production discards adaptation. |
| 02 Inertial | Standard Gaussian position/momentum, autocorrelation and step sweeps; nonlinear dense HOLA smoke check | Equal iterations do not imply equal derivative cost. HOLA's analytic provider is exact for this fixture; dense derivatives are guarded. |
| 03 Specialized | Mixture temperature/noise schedules and corrected replica swaps; Normal/Laplace latent learning against integrated likelihood | Endpoint ensembles, a correlated cold-replica trace and shared-parameter learning have distinct sampling units and objectives. |
| 04 Stein particles | Rank-two likelihood in eight prior-whitened dimensions; polynomial prediction with an exact induced Gaussian reference; chunked batched neural-network target with loop/vmap gradient agreement | pSVGD freezes prior complements. SVN is block diagonal, with actual CG operator costs. Function transport uses an actual function map and destination VJP. |
| 05 KSD | Correct, shifted, overdispersed and mode-missing samples; signed U/V curves and timing by size | All ordered pairs are evaluated in blocks. Signed U can be negative, and low KSD can coexist with missed modes. |
| 06 Ensemble/hybrid | Repulsive/WFR ensembles; known-parameter filtering vs exact Kalman; separate SA parameter learning; reduced nonlinear spatial inverse with refined quadrature and a separate nine-parameter full-grid posterior | Finite ensembles and backward pools are approximations. The spatial reduced model has its own coefficient prior. The full-grid example retains chain/time axes and reports finite-run diagnostics; uncertainty is propagated through the nonlinear field map. |
The small budgets deliberately expose Monte Carlo variation and incomplete learning. Increasing iterations alone does not resolve poor geometry, missed modes, inappropriate bandwidths or a wrong target. Reference moments, trace plots, mode fractions and estimator assumptions should be checked together.
The generated sampling and spatial uncertainty illustrations come directly from notebooks 1 and 6. Embedded notebook images are saved from those executions; no example plot is substituted for an algorithm result. Every scientific citation points to the consolidated references, and the algorithm register defines supported variants.
--output /tmp/lafa-executed preserves source notebooks while saving a second executed copy and execution-results.json. Failures preserve the notebook's underlying exception and return nonzero. An unavailable explicitly requested CUDA device is an error. The CPU results included in this checkout do not imply GPU validation.
For resources, run python benchmarks/performance.py --device cpu --compile --output /tmp/performance.json. Whole-sampler timings include target/gradient evaluation, randomness, validation and the selected outputs. Compilation covers only the potential and gradient; initialization is recorded separately and caches are not forced cold. CPU RSS is a cumulative process high-water mark and CUDA memory is an allocated-tensor peak.
The benchmark guide includes six-family statistical comparisons, batched model/VJP scaling, a longer full-data Bayesian neural-network example and full-grid nonlinear calibration with finite elliptical-slice references. These experiments have separate budgets from the quick notebooks. The validation report records measured performance variation, poor mixing and reference uncertainty.