A bridge from simulation-based inference to PyMC and NumPyro.
Many scientific models are simulators: they generate data from parameters, but do not provide the likelihood $p(x \mid \theta)$, the probability of an observation for a given set of parameters. That is exactly what Bayesian tools like PyMC and NumPyro need to recover the parameters behind observed data, so a simulator cannot be plugged into them directly.
setu (Sanskrit for bridge) closes that gap. It learns the likelihood from simulated data and exports it to a probabilistic programming language (PPL) in a single call, so the model, including priors, hierarchy, and posterior-predictive checks, is written in PyMC or NumPyro as usual. setu provides NLE, NRE, and MixedNLE estimators; training is backend-agnostic.
sbi implements neural likelihood estimation
too; setu is a JAX-native complement to it, not a replacement. Because the
estimator, its gradient, and the sampler compile into one program, setu targets
JAX-native samplers such as BlackJAX and NumPyro and tends to be faster on the
benchmarked task (see the
benchmarks).
Installation
pip install setu-sbi # core (JAX + FlowJAX)
pip install "setu-sbi[pymc]" # + PyMC / BlackJAX
pip install "setu-sbi[numpyro]" # + NumPyro
pip install "setu-sbi[tuning]" # + Optuna hyperparameter tuning
pip install "setu-sbi[all]" # everything above
The distribution is named setu-sbi on PyPI; the import name is setu.
Documentation
Full documentation lives at https://aai-institute.github.io/setu/:
- Tutorials: hand-held walkthroughs, from a simulator to a posterior in one sitting.
- How-to guides: task-oriented recipes, starting with installation.
- Reference: the full API, the
(G, S, T, *E)shape conventions, and a glossary. - Explanation: what SBI is, why validation matters, and why hierarchical inference is powerful.
New here? Start with the tutorials.
Contributing
Contributions and questions are welcome, from bug reports to documentation fixes to code. See CONTRIBUTING.md for setup, workflow, and how to file an issue. New contributors: CONTEXT.md is the project glossary, so a quick skim is the fastest way to get oriented.
uv sync --dev
uv run pytest tests/ -m "not slow" # fast tests (~2 min)
uv run ruff check setu/ tests/
Metadata
Release files for setu-sbi 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| setu_sbi-0.1.0.tar.gz | 123.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| setu_sbi-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 217.7 kB
Release files / setu_sbi-0.1.0.tar.gz
| Download URL | setu_sbi-0.1.0.tar.gz |
|---|---|
| Size | 123.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
db2206da63138f3c9219c78a136def6ac3471b1d70c207ea45a2ce91f7279fb0
|
|
BLAKE2b-256 checksum How to use checksums |
88a17134c21cc08beed13f1b16227edb3b0f9d7fe62653f79921e4dbf23c83be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / setu_sbi-0.1.0-py3-none-any.whl
| Download URL | setu_sbi-0.1.0-py3-none-any.whl |
|---|---|
| Size | 94.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e9edad6ee1aeec47511da2d3f5371014f7348692326b35f319c704f87dbd7aa
|
|
BLAKE2b-256 checksum How to use checksums |
ff04ae1637a51a3426b6b9d017f593ca123180c7aa0fac3695f8c51b9af4bf80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|