Imported from yzj623/pplab (
basicagent-skill/skill_library/paperbench/sequential-neural-score-estimation/skill/sbi_toolkit/sbi_snpe_training_loop/SKILL.md). Install upstream withnpx skills add yzj623/pplab --skill sbi_snpe_training_loop. Copyright stays with the author.
SBI SNPE Training Loop
Use this skill to train or emulate a small conditional neural posterior estimator from simulated (theta, x) pairs and query it at an observation.
Do not use it for SNLE/SNRE objectives or for posterior validation alone.
Inputs
- Simulated
thetaandxpairs. - Prior bounds or prior metadata.
- Observation
x_o. - Bounded training hyperparameters and seed.
Outputs
- Posterior samples for
x_o. - Training diagnostics and mechanism checks.
- Declaration of full-package or reduced/proxy execution.
Workflow
- Validate that
thetaandxare aligned and finite. - Fit a conditional posterior estimator that depends on
x. - Sample from the estimated posterior conditioned on
x_o. - Record loss/proxy diagnostics and sample summaries.
- Mark reduced implementations as proxy recovery.
Validation
Run:
python scripts/snpe_proxy.py --num-simulations 256 --observation 1.25
python tests/test_snpe_proxy.py
Limitations
- The included script is a reduced Gaussian SNPE-style proxy for fast recovery, not the full
sbipackage. - It must be declared as proxy recovery in soft mode.