Skip to content

janfb/pyro-meets-sbi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pyro Meets SBI: Hierarchical Simulation-Based Bayesian Inference

Open In Colab

EuroSciPy 2025 Talk Materials

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

Quick Links

Contents

📊 Slides

  • slides/ folder with markdown slides and image files
  • src/ folder with jupyter notebooks with code examples

Talk Abstract

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.

Key Topics Covered

  • 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

Learning Outcomes

After this talk, you will understand:

  1. When and why hierarchical models are beneficial
  2. How SBI enables inference for complex simulators
  3. How to combine Pyro and SBI in practice

Installation

The easiest way is with uv (fast Python package manager and envs).

  1. 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
  1. Create and activate a virtual environment
cd pyro-meets-sbi
uv venv .venv -p 3.11
source .venv/bin/activate
  1. Install dependencies
uv sync
  1. (Optional) Register a Jupyter kernel
python -m ipykernel install --user --name=pyro-meets-sbi

Launching the Notebooks

jupyter notebook

Open:

  • src/01_pyro_cookie_example.ipynb
  • src/02_pyro-sbi_cookie_example.ipynb

Open notebooks in Google Colab

  • Notebook 1: Open 01 in Colab
  • Notebook 2: Open 02 in Colab

Resources

Papers

Documentation

Acknowledgments

This work has been made possible through the support and contributions of many:

Communities

  • SBI Community - For developing and maintaining the sbi package, especially Seth Axen for implementing the Pyro wrapper during the SBI Hackathon 2024
    • Special acknowledgment to Seth Axen who implemented the wrapper from sbi to pyro (sbi-dev/sbi#1491)
  • Pyro Community - For creating an elegant probabilistic programming framework
  • EuroSciPy 2025 Organizers - For providing a platform to share this work

Institutions

  • appliedAI Institute for Europe - For supporting open-source scientific software development
  • University of Tübingen - For funding and research support for sbi

Contact

Jan Teusen (né Boelts)
TransferLab, appliedAI Institute for Europe
🔗 janfb.github.io

License

These materials are released under the Apache 2.0 License.


About

Materials for the EuroSciPy 2025 talk on using SBI for hierarchical inference in pyro

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages