计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
posterior_sample_approximation【效率与协作】Fit compact posterior approximations from SBI simulator pairs and emit posterior samples with optimizer traces.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill when an SBI recovery needs approximate posterior samples from simulation pairs and a fixed observation. It is designed for bounded reduced experiments where a full neural density estimator is unavailable, but the run must still perform an actual optimizer step and return posterior samples.
Do not use this skill as a substitute for a full neural SBI algorithm when that runtime is available. It is a reduced mechanism-preserving approximation.
theta and x arrays.loss_before, loss_after, params_before, params_after, and optimizer_state_changed.Run:
python scripts/posterior_sample_approximation.py self-test
python tests/test_posterior_sample_approximation.py
This script implements a small affine posterior mean model with diagonal Gaussian sampling noise. It demonstrates the benchmark mechanism and optimizer evidence, but it is not a normalizing-flow posterior estimator.
The optimizer_state_changed flag is evidence-bearing: a zero-step or otherwise frozen run must leave it false, with identical params_before and params_after.