sbi-dev/sbi
sbi is a Python package for simulation-based inference, designed to meet the needs of both researchers and practitioners. Whether you need fine-grained control or an easy-to-use interface, sbi has you covered.
What it solves
sbi helps you figure out the hidden parameters of a simulation model when you only have observed data. Instead of just giving a single best guess, it produces a full probability distribution over the parameters, showing which values are most likely, how uncertain they are, and how they interact with each other. This is useful when your model is too complex to compute the likelihood directly.
How it works
sbi uses Bayesian inference with neural networks. You provide a simulator that generates data from given parameters, plus the observed data you want to match. The package trains a neural network to learn the relationship between data and parameters, producing a posterior distribution. It offers both high-level interfaces (a few lines of code to get results) and low-level interfaces (fine-grained control over every step). It supports many state-of-the-art inference algorithms, including amortized methods that can be reused across many observations without retraining, and sequential methods that focus on a single observation to minimize simulations.
Who it’s for
Researchers and practitioners in fields like neuroscience, physics, biology, and engineering who have simulators and want to infer parameters from real-world data. It suits both beginners who want quick results and experts who need deep customization of the inference process.
Highlights
- High-level interfaces for quick, easy inference with just a few lines of code
- Low-level interfaces for fine-grained control over the inference workflow
- Supports amortized methods (reuse across observations) and sequential methods (optimize simulations per observation)
- Implements a wide range of algorithms: NPE, SNPE, NLE, SNLE, NRE, SNRE, SNVI, MNLE, and more
- Built-in validation tools to check the accuracy of inferred posteriors
- Plotting and analysis tools for visualizing and interpreting posterior distributions
- Requires Python 3.11+, optional GPU support, and easy installation via
uv, pip, conda, or pixi
Related
- Project
- Project
- Project
- Project
- Project