Welcome! This repository contains the slides and supporting materials for the talk "Pyro Meets SBI: Unlocking Hierarchical Bayesian Inference for Complex Simulators" presented at EuroSciPy 2025 in Kraków, Poland.
📍 Talk Details: EuroSciPy 2025 - Pyro Meets SBI
🎯 Tutorial: See also the companion SBI Tutorial
- 🔧 SBI Package: github.com/sbi-dev/sbi
- 🔥 Pyro: pyro.ai
- 🔄 Pyro-SBI Integration pull request by Seth Axen
slides/folder with markdown slides and image filessrc/folder with jupyter notebooks with code examples
Complex simulators are ubiquitous in science—from neural circuits to climate models—but often lack tractable likelihood functions. This talk demonstrates how to combine Pyro's elegant probabilistic programming with Simulation-Based Inference (SBI) to perform hierarchical Bayesian inference on such models.
- Hierarchical Modeling: Understanding pooled, unpooled, and hierarchical approaches
- Simulation-Based Inference: Neural approximation of likelihoods (NPE, NLE, NRE)
- Practical Integration: Wrapping SBI estimators as Pyro distributions
After this talk, you will understand:
- When and why hierarchical models are beneficial
- How SBI enables inference for complex simulators
- How to combine Pyro and SBI in practice
The easiest way is with uv (fast Python package manager and envs).
- Install uv (macOS)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Ensure uv is on PATH (new shells will pick this up)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
uv --version- Create and activate a virtual environment
cd pyro-meets-sbi
uv venv .venv -p 3.11
source .venv/bin/activate- Install dependencies
uv sync- (Optional) Register a Jupyter kernel
python -m ipykernel install --user --name=pyro-meets-sbijupyter notebookOpen:
src/01_pyro_cookie_example.ipynbsrc/02_pyro-sbi_cookie_example.ipynb
- SBI review paper: Cranmer et al. (2020) - The frontier of simulation-based inference
- SBI software paper: Boelts, Deistler et al. (2024) - sbi reloaded: a toolkit for simulation-based inference workflows
- SBI tutorial paper: Deistler, Boelts et al. (2025) - SBI: A practical guide
- SBI Documentation: sbi.readthedocs.io/en/latest/
- Pyro Documentation: docs.pyro.ai
- EuroSciPy SBI Tutorial: Link to GitHub
This work has been made possible through the support and contributions of many:
- SBI Community - For developing and maintaining the
sbipackage, especially Seth Axen for implementing the Pyro wrapper during the SBI Hackathon 2024- Special acknowledgment to Seth Axen who implemented the wrapper from
sbitopyro(sbi-dev/sbi#1491)
- Special acknowledgment to Seth Axen who implemented the wrapper from
- Pyro Community - For creating an elegant probabilistic programming framework
- EuroSciPy 2025 Organizers - For providing a platform to share this work
- appliedAI Institute for Europe - For supporting open-source scientific software development
- University of Tübingen - For funding and research support for
sbi
Jan Teusen (né Boelts)
TransferLab, appliedAI Institute for Europe
🔗 janfb.github.io
These materials are released under the Apache 2.0 License.