Skip to main content

Simulation-based inference.

Project description

PyPI version Contributions welcome GitHub license codecov Tests

sbi: simulation-based inference

sbi is a PyTorch package for simulation-based inference. Simulation-based inference is the process of finding parameters of a simulator from observations.

sbi takes a Bayesian approach and returns a full posterior distribution over the parameters, conditional on the observations. This posterior can be amortized (i.e. useful for any observation) or focused (i.e. tailored to a particular observation), with different computational trade-offs.

sbi offers a simple interface for one-line posterior inference.

from sbi.inference import infer
# import your simulator, define your prior over the parameters
parameter_posterior = infer(simulator, prior, method='SNPE', num_simulations=100)

See below for the available methods of inference, SNPE, SNRE and SNLE.

Installation

sbi requires Python 3.6 or higher. It can be installed using pip:

$ pip install sbi

We recommend to use a conda virtual environment (Miniconda installation instructions). If conda is installed on the system, an environment for installing sbi can be created as follows:

# Create an environment for sbi (indicate Python 3.6 or higher); activate it
$ conda create -n sbi_env python=3.6 && conda activate sbi_env

To test the installation, drop into a python prompt and run

from sbi.examples.minimal import simple
posterior = simple()
print(posterior)

Inference Algorithms

The following algorithms are currently available:

Sequential Neural Posterior Estimation (SNPE)

Sequential Neural Likelihood Estimation (SNLE)

Sequential Neural Ratio Estimation (SNRE)

Feedback and Contributions

We would like to hear how sbi is working for your inference problems as well as receive bug reports, pull requests and other feedback (see contribute).

Acknowledgements

sbi is the successor (using PyTorch) of the delfi package. It was started as a fork of Conor M. Durkan's lfi. sbi runs as a community project; development is coordinated at the mackelab. See also credits.

Support

sbi has been developed in the context of the ADIMEM grant, project A. ADIMEM is a BMBF grant awarded to groups at the Technical University of Munich, University of Tübingen and Research Center caesar of the Max Planck Gesellschaft.

License

AGPLv3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sbi-0.11.0.tar.gz (694.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sbi-0.11.0-py2.py3-none-any.whl (113.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file sbi-0.11.0.tar.gz.

File metadata

  • Download URL: sbi-0.11.0.tar.gz
  • Upload date:
  • Size: 694.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1.post20200616 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.6

File hashes

Hashes for sbi-0.11.0.tar.gz
Algorithm Hash digest
SHA256 9a907d0e55278bffa5335e8ddeeaa8586c6934ffcbf182be81e67148f4825382
MD5 de1325f53c059bbfdb2415b2ff198ec2
BLAKE2b-256 e9015ea0d79b71f5f2fbf327ae692974da3fe9087498828a2bec80abf7d73620

See more details on using hashes here.

File details

Details for the file sbi-0.11.0-py2.py3-none-any.whl.

File metadata

  • Download URL: sbi-0.11.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 113.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1.post20200616 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.6

File hashes

Hashes for sbi-0.11.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0da185c268dbdfd8a0a197918cac3e4e746f4b9faac1104498548b5492a7fe42
MD5 4e79c1c9b6c758b2fbd2fa02a9c62a9f
BLAKE2b-256 c42c8d6a1d98359faf592a6757aa1eb4b607ed77321c1a09fe3481f69d6df9af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page