Universal scalable simulation-based inference with TMNRE (Truncated Marginal Neural Ratio Estimation) and pytorch-lightning.
Project description
Swyft is a system for scientific simulation-based inference at scale.
Swyft is the official implementation of Truncated Marginal Neural Ratio Estimation (TMNRE), a hyper-efficient, simulation-based inference technique for complex data and expensive simulators.
Swyft in action
Swyft makes it convenient to perform Bayesian or Frequentist inference of hundreds, thousands or millions of parameter posteriors by constructing optimal data summaries.
To this end, Swyft estimates likelihood-to-evidence ratios for arbitrary marginal posteriors; they typically require fewer simulations than the corresponding joint.
Swyft performs targeted inference by prior truncation, combining simulation efficiency with empirical testability.
Swyft is based on stochastic simulators, which map parameters stochastically to observational data. Swyft makes it convenient to define such simulators as graphical models.
In scientific settings, a cost-benefit analysis often favors approximating the posterior marginality; swyft provides this functionality.
The package additionally implements our prior truncation technique, routines to empirically test results by estimating the expected coverage, and a simulator manager with zarr storage to simplify use with complex simulators.
Papers using Swyft/TMNRE
2021
“Fast and Credible Likelihood-Free Cosmology with Truncated Marginal Neural Ratio Estimation“ Cole+ https://arxiv.org/abs/2111.08030
2022
“Estimating the warm dark matter mass from strong lensing images with truncated marginal neural ratio estimation” Anau Montel+, https://arxiv.org/abs/2205.09126
“SICRET: Supernova Ia Cosmology with truncated marginal neural Ratio EsTimation” Karchev+ https://arxiv.org/abs/2209.06733
“One never walks alone: the effect of the perturber population on subhalo measurements in strong gravitational lenses” Coogan+ https://arxiv.org/abs/2209.09918
“Detection is truncation: studying source populations with truncated marginal neural ratio estimation” Anau Montel+ https://arxiv.org/abs/2211.04291
2023
“Debiasing Standard Siren Inference of the Hubble Constant with Marginal Neural Ratio Estimation” Gagnon-Hartman+ https://arxiv.org/abs/2301.05241
“Constraining the X-ray heating and reionization using 21-cm power spectra with Marginal Neural Ratio Estimation” Saxena+ https://arxiv.org/abs/2303.07339
“Peregrine: Sequential simulation-based inference for gravitational wave signals”, Bhardwaj+ https://arxiv.org/abs/2304.02035
“Albatross: A scalable simulation-based inference pipeline for analysing stellar streams in the Milky Way”, Alvey+ https://arxiv.org/abs/2304.02032
Further information
Documentation & installation: https://swyft.readthedocs.io/
Example usage: https://swyft.readthedocs.io/en/latest/tutorial-notebooks.html
Source code: https://github.com/undark-lab/swyft
Support & discussion: https://github.com/undark-lab/swyft/discussions
Bug reports: https://github.com/undark-lab/swyft/issues
Contributing: https://swyft.readthedocs.io/en/latest/contributing-link.html
Citation: https://swyft.readthedocs.io/en/latest/citation.html
Swyft history
As of v0.4.0, Swyft is based on pytorch-lightning, with a completely updated
tmnre is the implementation of the paper Truncated Marginal Neural Ratio Estimation.
v0.1.2 is the implementation of the paper Simulation-efficient marginal posterior estimation with swyft: stop wasting your precious time.
Relevant packages
sbi is a collection of simulation-based inference methods. Unlike Swyft, the repository does not include our truncation scheme nor marginal estimation of posteriors.
lampe is an implementation of amoritzed simulation-based inference methods aimed at simulation-based inference researchers due to its flexibility.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file swyft-0.4.5.tar.gz
.
File metadata
- Download URL: swyft-0.4.5.tar.gz
- Upload date:
- Size: 11.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59b7c8f846fa858c20b15b3fdc7555386a644ef40fb76aedd60277448f61ddf4 |
|
MD5 | c5bee00c11e79fbad6f7749eec8a0351 |
|
BLAKE2b-256 | 2252bb357be716568e8651051c3ae12450b58fffcebaa1d53cd9fa12fa078f87 |
File details
Details for the file swyft-0.4.5-py3-none-any.whl
.
File metadata
- Download URL: swyft-0.4.5-py3-none-any.whl
- Upload date:
- Size: 52.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b323f2fba2cae1d33f3900d3b081beb72489a76b8bf7838e3b585ea058413bc |
|
MD5 | 4e18e4ef56f0096be89cc81de2354b90 |
|
BLAKE2b-256 | 445ebd80729741be37df4f31bbcb915c57e0678ee66c53e8f83774de79a576a2 |