Skip to main content

Normalizing flow exhanced sampler in jax

Project description

flowMC

Normalizing-flow enhanced sampling package for probabilistic inference

doc doc

flowMC_logo

flowMC is a Jax-based python package for normalizing-flow enhanced Markov chain Monte Carlo (MCMC) sampling. The code is open source under MIT license, and it is under active development.

  • Just-in-time compilation is supported.
  • Native support for GPU acceleration.
  • Suit for problems with multi-modality.
  • Minimal tuning.

Installation

The simplest way to install the package is to do it through pip

pip install flowMC

This will install the latest stable release and its dependencies. flowMC is based on Jax and Equinox. By default, installing flowMC will automatically install Jax and Equinox available on PyPI. Jax does not install GPU support by default. If you want to use GPU with Jax, you need to install Jax with GPU support according to their document. At the time of writing this documentation page, this is the command to install Jax with GPU support:

pip install --upgrade "jax[cuda12_pip]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html

If you want to install the latest version of flowMC, you can clone this repo and install it locally:

git clone https://github.com/kazewong/flowMC.git
cd flowMC
pip install -e .

Requirements

Here is a list of packages we use in the main library

* Python 3.9+
* Jax
* Jaxlib
* equinox

To visualize the inference results in the examples, we requrie the following packages in addtion to the above:

* matplotlib
* corner
* arviz

The test suite is based on pytest. To run the tests, one needs to install pytest and run pytest at the root directory of this repo.

Attribution

If you used flowMC in your research, we would really appericiate it if you could at least cite the following papers:

@article{Wong:2022xvh,
    author = "Wong, Kaze W. k. and Gabri\'e, Marylou and Foreman-Mackey, Daniel",
    title = "{flowMC: Normalizing flow enhanced sampling package for probabilistic inference in JAX}",
    eprint = "2211.06397",
    archivePrefix = "arXiv",
    primaryClass = "astro-ph.IM",
    doi = "10.21105/joss.05021",
    journal = "J. Open Source Softw.",
    volume = "8",
    number = "83",
    pages = "5021",
    year = "2023"
}

@article{Gabrie:2021tlu,
    author = "Gabri\'e, Marylou and Rotskoff, Grant M. and Vanden-Eijnden, Eric",
    title = "{Adaptive Monte Carlo augmented with normalizing flows}",
    eprint = "2105.12603",
    archivePrefix = "arXiv",
    primaryClass = "physics.data-an",
    doi = "10.1073/pnas.2109420119",
    journal = "Proc. Nat. Acad. Sci.",
    volume = "119",
    number = "10",
    pages = "e2109420119",
    year = "2022"
}

This will help flowMC getting more recognition, and the main benefit for you is this means the flowMC community will grow and it will be continuously improved. If you believe in the magic of open-source software, please support us by attributing our software in your work.

flowMC is a Jax implementation of methods described in:

Efficient Bayesian Sampling Using Normalizing Flows to Assist Markov Chain Monte Carlo Methods Gabrié M., Rotskoff G. M., Vanden-Eijnden E. - ICML INNF+ workshop 2021 - pdf

Adaptive Monte Carlo augmented with normalizing flows. Gabrié M., Rotskoff G. M., Vanden-Eijnden E. - PNAS 2022 - doi, arxiv

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

flowMC-0.3.0.tar.gz (28.1 kB view details)

Uploaded Source

Built Distribution

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

flowMC-0.3.0-py3-none-any.whl (35.7 kB view details)

Uploaded Python 3

File details

Details for the file flowMC-0.3.0.tar.gz.

File metadata

  • Download URL: flowMC-0.3.0.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.9

File hashes

Hashes for flowMC-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b15d3d64e2cb9d3d91dc1f81bbb565cac69026d7202a6ac9f06c5c069e4d9156
MD5 11923b56d5da140f2788420cba8879ee
BLAKE2b-256 473573b7785b2ab407d23f93e94fa1dbd3d7ee1f06a4eec651615ba4c1ce0ae9

See more details on using hashes here.

File details

Details for the file flowMC-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: flowMC-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 35.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.9

File hashes

Hashes for flowMC-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8bbf305148b5f14180864a80bc93a749d525d6635ebe286e8b2d4e65dce8603
MD5 a900908aba834665575b59ea39fd7e2b
BLAKE2b-256 be644f507ac62a6bf491c6c76034fef958762a42ad9b86a1d97aeef50a4528c6

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