Metadata-Version: 2.4
Name: flowMC
Version: 0.4.3
Summary: Normalizing flow exhanced sampler in jax
Project-URL: Documentation, https://github.com/kazewong/flowMC
Author: Marylou Gabrié, Dan Foreman-Mackey
Author-email: Kaze Wong <kazewong.physics@gmail.com>
License: MIT License
        
        Copyright (c) 2022 Kaze Wong & contributor
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: autodiff,inference,jax,machine learning,normalizing,sampling
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.11
Requires-Dist: chex>=0.1.87
Requires-Dist: equinox>=0.11.9
Requires-Dist: jax[cpu]>=0.5.0
Requires-Dist: jaxtyping>=0.2.36
Requires-Dist: optax>=0.2.4
Requires-Dist: scikit-learn>=1.6.0
Requires-Dist: tqdm>=4.67.1
Provides-Extra: codeqa
Requires-Dist: coveralls>=4.0.1; extra == 'codeqa'
Requires-Dist: pre-commit>=4.0.1; extra == 'codeqa'
Requires-Dist: pyright>=1.1.389; extra == 'codeqa'
Requires-Dist: pytest>=8.3.3; extra == 'codeqa'
Requires-Dist: ruff>=0.8.0; extra == 'codeqa'
Provides-Extra: cuda
Requires-Dist: jax[cuda12]>=0.5.0; extra == 'cuda'
Provides-Extra: docs
Requires-Dist: mkdocs-gen-files==0.5.0; extra == 'docs'
Requires-Dist: mkdocs-jupyter==0.25.1; extra == 'docs'
Requires-Dist: mkdocs-literate-nav==0.6.1; extra == 'docs'
Requires-Dist: mkdocs-material==9.5.47; extra == 'docs'
Requires-Dist: mkdocs==1.6.1; extra == 'docs'
Requires-Dist: mkdocstrings[python]==0.27.0; extra == 'docs'
Requires-Dist: pymdown-extensions==10.12; extra == 'docs'
Provides-Extra: visualize
Requires-Dist: arviz>=0.21.0; extra == 'visualize'
Requires-Dist: corner>=2.2.3; extra == 'visualize'
Requires-Dist: matplotlib>=3.9.3; extra == 'visualize'
Description-Content-Type: text/markdown

# flowMC

**Normalizing-flow enhanced sampling package for probabilistic inference**

<a href="https://flowmc.readthedocs.io/en/main/">
<img src="https://readthedocs.org/projects/flowmc/badge/?version=main&style=flat-square" alt="doc"/>
</a>
<a href="https://github.com/kazewong/flowMC/blob/Packaging/LICENSE">
<img src="https://img.shields.io/badge/License-MIT-blue?style=flat-square" alt="doc"/>
</a>
<a href='https://coveralls.io/github/kazewong/flowMC?branch=main'><img src='https://img.shields.io/coverallsCoverage/github/kazewong/flowMC?style=flat-square' alt='Coverage Status' /></a>

> [!WARNING]
> Note that `flowMC` has not reached v1.0.0, meaning the API could subject to changes. In general, the higher level the API, the less likely it is going to change. However, intermediate level API such as the resource strategy interface could subject to major revision for performance concerns.

![flowMC_logo](./docs/logo_0810.png)

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](https://github.com/google/jax) and [Equinox](https://github.com/patrick-kidger/equinox).
By default, installing flowMC will automatically install Jax and Equinox available on [PyPI](https://pypi.org).
By default this install the CPU version of Jax. If you have a GPU and want to use it, you can install the GPU version of Jax by running:

```
pip install flowMC[cuda]
```

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 .
```

There are a couple more extras that you can install with flowMC, including:
- `flowMC[docs]`: Install the documentation dependencies.
- `flowMC[codeqa]`: Install the code quality dependencies.
- `flowMC[visualize]`: Install the visualization dependencies.

On top of `pip` installation, we highly encourage you to use [uv](https://docs.astral.sh/uv/) to manage your python environment. Once you clone the repo, you can run `uv sync` to create a virtual environment with all the dependencies installed.
# 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](https://openreview.net/pdf?id=mvtooHbjOwx)

> *Adaptive Monte Carlo augmented with normalizing flows.*
Gabrié M., Rotskoff G. M., Vanden-Eijnden E. - PNAS 2022 - [doi](https://www.pnas.org/doi/10.1073/pnas.2109420119), [arxiv](https://arxiv.org/abs/2105.12603)

## Contributors

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tbody>
    <tr>
      <td align="center" valign="top" width="14.28%"><a href="http://secondearths.sakura.ne.jp/en/index.html"><img src="https://avatars.githubusercontent.com/u/15956904?v=4?s=100" width="100px;" alt="Hajime Kawahara"/><br /><sub><b>Hajime Kawahara</b></sub></a><br /><a href="https://github.com/kazewong/flowMC/issues?q=author%3AHajimeKawahara" title="Bug reports">🐛</a></td>
      <td align="center" valign="top" width="14.28%"><a href="https://github.com/daniel-dodd"><img src="https://avatars.githubusercontent.com/u/68821880?v=4?s=100" width="100px;" alt="Daniel Dodd"/><br /><sub><b>Daniel Dodd</b></sub></a><br /><a href="https://github.com/kazewong/flowMC/commits?author=daniel-dodd" title="Documentation">📖</a> <a href="https://github.com/kazewong/flowMC/pulls?q=is%3Apr+reviewed-by%3Adaniel-dodd" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/kazewong/flowMC/commits?author=daniel-dodd" title="Tests">⚠️</a> <a href="https://github.com/kazewong/flowMC/issues?q=author%3Adaniel-dodd" title="Bug reports">🐛</a></td>
      <td align="center" valign="top" width="14.28%"><a href="http://matt-graham.github.io"><img src="https://avatars.githubusercontent.com/u/6746980?v=4?s=100" width="100px;" alt="Matt Graham"/><br /><sub><b>Matt Graham</b></sub></a><br /><a href="https://github.com/kazewong/flowMC/issues?q=author%3Amatt-graham" title="Bug reports">🐛</a> <a href="https://github.com/kazewong/flowMC/commits?author=matt-graham" title="Tests">⚠️</a> <a href="https://github.com/kazewong/flowMC/pulls?q=is%3Apr+reviewed-by%3Amatt-graham" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/kazewong/flowMC/commits?author=matt-graham" title="Documentation">📖</a></td>
      <td align="center" valign="top" width="14.28%"><a href="https://www.kaze-wong.com/"><img src="https://avatars.githubusercontent.com/u/8803931?v=4?s=100" width="100px;" alt="Kaze Wong"/><br /><sub><b>Kaze Wong</b></sub></a><br /><a href="https://github.com/kazewong/flowMC/issues?q=author%3Akazewong" title="Bug reports">🐛</a> <a href="#blog-kazewong" title="Blogposts">📝</a> <a href="https://github.com/kazewong/flowMC/commits?author=kazewong" title="Code">💻</a> <a href="#content-kazewong" title="Content">🖋</a> <a href="https://github.com/kazewong/flowMC/commits?author=kazewong" title="Documentation">📖</a> <a href="#example-kazewong" title="Examples">💡</a> <a href="#infra-kazewong" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-kazewong" title="Maintenance">🚧</a> <a href="#research-kazewong" title="Research">🔬</a> <a href="https://github.com/kazewong/flowMC/pulls?q=is%3Apr+reviewed-by%3Akazewong" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/kazewong/flowMC/commits?author=kazewong" title="Tests">⚠️</a> <a href="#tutorial-kazewong" title="Tutorials">✅</a></td>
      <td align="center" valign="top" width="14.28%"><a href="https://marylou-gabrie.github.io/"><img src="https://avatars.githubusercontent.com/u/11092071?v=4?s=100" width="100px;" alt="Marylou Gabrié"/><br /><sub><b>Marylou Gabrié</b></sub></a><br /><a href="https://github.com/kazewong/flowMC/issues?q=author%3Amarylou-gabrie" title="Bug reports">🐛</a> <a href="https://github.com/kazewong/flowMC/commits?author=marylou-gabrie" title="Code">💻</a> <a href="#content-marylou-gabrie" title="Content">🖋</a> <a href="https://github.com/kazewong/flowMC/commits?author=marylou-gabrie" title="Documentation">📖</a> <a href="#example-marylou-gabrie" title="Examples">💡</a> <a href="#maintenance-marylou-gabrie" title="Maintenance">🚧</a> <a href="#research-marylou-gabrie" title="Research">🔬</a> <a href="https://github.com/kazewong/flowMC/commits?author=marylou-gabrie" title="Tests">⚠️</a> <a href="#tutorial-marylou-gabrie" title="Tutorials">✅</a></td>
      <td align="center" valign="top" width="14.28%"><a href="https://github.com/Qazalbash"><img src="https://avatars.githubusercontent.com/u/62182585?v=4?s=100" width="100px;" alt="Meesum Qazalbash"/><br /><sub><b>Meesum Qazalbash</b></sub></a><br /><a href="https://github.com/kazewong/flowMC/commits?author=Qazalbash" title="Code">💻</a> <a href="#maintenance-Qazalbash" title="Maintenance">🚧</a></td>
      <td align="center" valign="top" width="14.28%"><a href="https://github.com/thomasckng"><img src="https://avatars.githubusercontent.com/u/97585527?v=4?s=100" width="100px;" alt="Thomas Ng"/><br /><sub><b>Thomas Ng</b></sub></a><br /><a href="https://github.com/kazewong/flowMC/commits?author=thomasckng" title="Code">💻</a> <a href="#maintenance-thomasckng" title="Maintenance">🚧</a></td>
    </tr>
    <tr>
      <td align="center" valign="top" width="14.28%"><a href="https://github.com/tedwards2412"><img src="https://avatars.githubusercontent.com/u/6105841?v=4?s=100" width="100px;" alt="Thomas Edwards"/><br /><sub><b>Thomas Edwards</b></sub></a><br /><a href="https://github.com/kazewong/flowMC/issues?q=author%3Atedwards2412" title="Bug reports">🐛</a> <a href="https://github.com/kazewong/flowMC/commits?author=tedwards2412" title="Code">💻</a></td>
    </tr>
  </tbody>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

 
