Nested Sampling in JAX
Project description
What is it?
Enables probabilistic programming using nested sampling. It's coded in JAX in a manner that allows lowering the entire inference algorithm to XLA primitives, which are JIT-compiled for high performance. You can read about it here: (https://arxiv.org/abs/2012.15286)
JAXNS provides a constrained likelihood sampler which combines and modifies ideas from MultiNest (F. Feroz et al. 2008; https://arxiv.org/pdf/0809.3437.pdf) and PolyChord (W.J. Handley et al. 2015; https://arxiv.org/abs/1506.00171).
There are two samplers available provided by setting sampler_name=slice for slice sampling, and sampler_name=multi_ellipsoid for rejection sampling.
Install
Make sure you have JAX and the usual suspects with pip install jax jaxlib numpy matplotlib scipy.
Install with pip install jaxns or pip install git+http://github.com/Joshuaalbert/jaxns.git.
Quick start
JAXNS is really fast because it uses JAX. The caveat is that you need to be able to define your likelihood function with JAX. This is usually no big deal because JAX is just a replacement for numpy and many likelihoods can be expressed such. If you're unfamiliar, take a quick tour of JAX (https://jax.readthedocs.io/en/latest/notebooks/quickstart.html). For a simple example see the simple multivariate normal likelihood with conjugate prior example
Speed test comparison with other nested sampling packages
JAXNS is much faster than PolyChord, MultiNEST, and dynesty, typically achieving two to three orders of magnitude improvement in speed. I show this in (https://arxiv.org/abs/2012.15286).
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jaxns-0.0.3.tar.gz.
File metadata
- Download URL: jaxns-0.0.3.tar.gz
- Upload date:
- Size: 70.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31e5ef2989c2b9fe463b7a82976a06f140b21f40b59f8376a3f9b0fe00c4fd4c
|
|
| MD5 |
c637017ac8957ecbc912a9eee2201c20
|
|
| BLAKE2b-256 |
567078cee39ec66795236a1c8cf1f6a1e043f27da5410e35e218261a248d2a68
|
File details
Details for the file jaxns-0.0.3-py3-none-any.whl.
File metadata
- Download URL: jaxns-0.0.3-py3-none-any.whl
- Upload date:
- Size: 101.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8869ecf5873fe1808ea04d92dcc9d7e5c2fa9096c96b0ba595a4887c6da06e6d
|
|
| MD5 |
6fd6b5571ba2c1c14227ef33ee0de601
|
|
| BLAKE2b-256 |
40b0729d508f500f48119669ca1f45e6d017b177a89129c326d46def82062aa2
|