Skip to content
Back to skills

Sbi Neural Training

ASecurity

Train or proxy-train SBI density estimator families on simulator-generated parameter observation pairs.

  • 247 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 9, 2026
testingpythongobashapi

Works with

  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill sbi_neural_training --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sbi Neural Training?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sbi Neural Training
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-sbi-neural-training/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-sbi-neural-training)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: sbi_neural_training
description: Train or proxy-train SBI density estimator families on simulator-generated parameter observation pairs.
---

# SBI Neural Training

Use this skill when simulation records need to be converted into a trained estimator for an `sbi`-style workflow. It covers the paper's SNPE, SNLE, and SNRE family distinction and provides a deterministic reduced SNPE-like proxy for environments where the full `sbi` and PyTorch stack is unavailable.

Do not report the reduced proxy as a full `sbi` run. The proxy is only valid when recovery mode permits reduced evidence and the runtime handoff records why the full stack is blocked.

## Inputs

- Valid simulation records with `theta` and `x` vectors.
- Algorithm family: `SNPE`, `SNLE`, or `SNRE`.
- Training parameters such as learning rate and optimizer steps.
- A reduced-runtime allowance flag when the full stack is unavailable.

## Outputs

- A trained estimator dictionary with scalar conditional-posterior parameters for reduced SNPE-style recovery.
- A training trace with `loss_before`, `loss_after`, `params_before`, `params_after`, and `optimizer_state_changed`.
- Family metadata identifying which paper algorithm family was represented.

## Workflow

1. Verify that records contain paired numeric `theta` and `x` values.
2. Select the SBI family. Full recovery should call the corresponding package trainer when available.
3. In reduced mode, train a scalar conditional Gaussian posterior mean `theta_hat = a * x + b`.
4. Record the parameter update and loss movement before and after optimization.
5. Pass the estimator to the posterior API skill for conditioning, sampling, and log-probability checks.

## Validation

Run:

```bash
python /share/project/yuyang/workspace/Paper2Skills/Distiller/skills/module-to-skill/scripts/validate_skill_tree.py /share/project/yuyang/workspace/Paperbench/record/case15/extracted_skills_attempt_001/sbi_toolkit/sbi_neural_training --run-tests
```

For a standalone smoke run:

```bash
python scripts/neural_training.py --demo
```

## Limitations

The reduced trainer is intentionally tiny and standard-library only. It preserves the simulator-to-estimator training mechanism but does not implement normalizing flows, MCMC, classifier ratio estimation, PyTorch autograd, or multi-round proposal adaptation.

Files in this skill

  • SKILL.md2.3 KB
  • scripts/neural_training.py4.8 KB
  • tests/test_neural_training.py760 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.