flowMC 0.4.0__tar.gz → 0.4.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. flowmc-0.4.2/.all-contributorsrc +113 -0
  2. {flowmc-0.4.0 → flowmc-0.4.2}/.gitignore +3 -0
  3. {flowmc-0.4.0 → flowmc-0.4.2}/PKG-INFO +31 -1
  4. flowmc-0.4.2/README.md +140 -0
  5. {flowmc-0.4.0 → flowmc-0.4.2}/docs/tutorials/custom_strategy.ipynb +22 -12
  6. flowmc-0.4.2/docs/tutorials/dualmoon.ipynb +522 -0
  7. flowmc-0.4.2/docs/tutorials/parallel_tempering.ipynb +382 -0
  8. flowmc-0.4.2/docs/tutorials/train_normalizing_flow.ipynb +508 -0
  9. {flowmc-0.4.0 → flowmc-0.4.2}/mkdocs.yml +2 -0
  10. {flowmc-0.4.0 → flowmc-0.4.2}/pyproject.toml +1 -1
  11. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/Sampler.py +19 -5
  12. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/resource/local_kernel/Gaussian_random_walk.py +4 -4
  13. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/resource/local_kernel/HMC.py +3 -2
  14. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/resource/local_kernel/MALA.py +4 -4
  15. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/resource/local_kernel/base.py +3 -3
  16. flowmc-0.4.2/src/flowMC/resource/logPDF.py +115 -0
  17. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/resource/nf_model/NF_proposal.py +4 -5
  18. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/resource_strategy_bundles.py +17 -12
  19. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/strategy/global_tuning.py +4 -9
  20. flowmc-0.4.2/src/flowMC/strategy/parallel_tempering.py +398 -0
  21. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/strategy/take_steps.py +19 -15
  22. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/strategy/train_model.py +1 -1
  23. {flowmc-0.4.0 → flowmc-0.4.2}/test/integration/test_HMC.py +5 -2
  24. {flowmc-0.4.0 → flowmc-0.4.2}/test/integration/test_MALA.py +5 -2
  25. {flowmc-0.4.0 → flowmc-0.4.2}/test/integration/test_RWMCMC.py +5 -2
  26. {flowmc-0.4.0 → flowmc-0.4.2}/test/unit/test_kernels.py +37 -41
  27. flowmc-0.4.2/test/unit/test_resources.py +77 -0
  28. {flowmc-0.4.0 → flowmc-0.4.2}/test/unit/test_strategies.py +202 -18
  29. flowmc-0.4.0/README.md +0 -110
  30. flowmc-0.4.0/docs/tutorials/dualmoon.ipynb +0 -521
  31. flowmc-0.4.0/docs/tutorials/train_normalizing_flow.ipynb +0 -508
  32. flowmc-0.4.0/test/unit/test_resources.py +0 -16
  33. {flowmc-0.4.0 → flowmc-0.4.2}/.coverage +0 -0
  34. {flowmc-0.4.0 → flowmc-0.4.2}/.gitattributes +0 -0
  35. {flowmc-0.4.0 → flowmc-0.4.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  36. {flowmc-0.4.0 → flowmc-0.4.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  37. {flowmc-0.4.0 → flowmc-0.4.2}/.github/workflows/pre-commit.yml +0 -0
  38. {flowmc-0.4.0 → flowmc-0.4.2}/.github/workflows/python-publish.yml +0 -0
  39. {flowmc-0.4.0 → flowmc-0.4.2}/.github/workflows/run_tests.yml +0 -0
  40. {flowmc-0.4.0 → flowmc-0.4.2}/.github/workflows/workflowsjoss.yml +0 -0
  41. {flowmc-0.4.0 → flowmc-0.4.2}/.pre-commit-config.yaml +0 -0
  42. {flowmc-0.4.0 → flowmc-0.4.2}/CODE_OF_CONDUCT.md +0 -0
  43. {flowmc-0.4.0 → flowmc-0.4.2}/CONTRIBUTING.md +0 -0
  44. {flowmc-0.4.0 → flowmc-0.4.2}/LICENSE +0 -0
  45. {flowmc-0.4.0 → flowmc-0.4.2}/docs/FAQ.md +0 -0
  46. {flowmc-0.4.0 → flowmc-0.4.2}/docs/communityExamples.md +0 -0
  47. {flowmc-0.4.0 → flowmc-0.4.2}/docs/configuration.md +0 -0
  48. {flowmc-0.4.0 → flowmc-0.4.2}/docs/contribution.md +0 -0
  49. {flowmc-0.4.0 → flowmc-0.4.2}/docs/dual_moon.png +0 -0
  50. {flowmc-0.4.0 → flowmc-0.4.2}/docs/gen_ref_pages.py +0 -0
  51. {flowmc-0.4.0 → flowmc-0.4.2}/docs/index.md +0 -0
  52. {flowmc-0.4.0 → flowmc-0.4.2}/docs/logo_0810.png +0 -0
  53. {flowmc-0.4.0 → flowmc-0.4.2}/docs/quickstart.md +0 -0
  54. {flowmc-0.4.0 → flowmc-0.4.2}/docs/requirements.txt +0 -0
  55. {flowmc-0.4.0 → flowmc-0.4.2}/docs/stylesheets/extra.css +0 -0
  56. {flowmc-0.4.0 → flowmc-0.4.2}/docs/tutorials/dual_moon.png +0 -0
  57. {flowmc-0.4.0 → flowmc-0.4.2}/docs/tutorials/loading_resources.ipynb +0 -0
  58. {flowmc-0.4.0 → flowmc-0.4.2}/joss/paper.bib +0 -0
  59. {flowmc-0.4.0 → flowmc-0.4.2}/joss/paper.md +0 -0
  60. {flowmc-0.4.0 → flowmc-0.4.2}/readthedocs.yml +0 -0
  61. {flowmc-0.4.0 → flowmc-0.4.2}/ruff.toml +0 -0
  62. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/__init__.py +0 -0
  63. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/resource/__init__.py +0 -0
  64. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/resource/base.py +0 -0
  65. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/resource/buffers.py +0 -0
  66. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/resource/local_kernel/__init__.py +0 -0
  67. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/resource/nf_model/__init__.py +0 -0
  68. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/resource/nf_model/base.py +0 -0
  69. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/resource/nf_model/common.py +0 -0
  70. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/resource/nf_model/realNVP.py +0 -0
  71. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/resource/nf_model/rqSpline.py +0 -0
  72. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/resource/optimizer.py +0 -0
  73. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/strategy/__init__.py +0 -0
  74. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/strategy/base.py +0 -0
  75. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/strategy/importance_sampling.py +0 -0
  76. {flowmc-0.4.0 → flowmc-0.4.2}/src/flowMC/strategy/optimization.py +0 -0
  77. {flowmc-0.4.0 → flowmc-0.4.2}/test/integration/test_normalizingFlow.py +0 -0
  78. {flowmc-0.4.0 → flowmc-0.4.2}/test/integration/test_quickstart.py +0 -0
  79. {flowmc-0.4.0 → flowmc-0.4.2}/test/unit/test_nf.py +0 -0
  80. {flowmc-0.4.0 → flowmc-0.4.2}/uv.lock +0 -0
@@ -0,0 +1,113 @@
1
+ {
2
+ "projectName": "flowMC",
3
+ "projectOwner": "kazewong",
4
+ "files": [
5
+ "README.md"
6
+ ],
7
+ "commitType": "docs",
8
+ "commitConvention": "angular",
9
+ "contributorsPerLine": 7,
10
+ "contributors": [
11
+ {
12
+ "login": "HajimeKawahara",
13
+ "name": "Hajime Kawahara",
14
+ "avatar_url": "https://avatars.githubusercontent.com/u/15956904?v=4",
15
+ "profile": "http://secondearths.sakura.ne.jp/en/index.html",
16
+ "contributions": [
17
+ "bug"
18
+ ]
19
+ },
20
+ {
21
+ "login": "daniel-dodd",
22
+ "name": "Daniel Dodd",
23
+ "avatar_url": "https://avatars.githubusercontent.com/u/68821880?v=4",
24
+ "profile": "https://github.com/daniel-dodd",
25
+ "contributions": [
26
+ "doc",
27
+ "review",
28
+ "test",
29
+ "bug"
30
+ ]
31
+ },
32
+ {
33
+ "login": "matt-graham",
34
+ "name": "Matt Graham",
35
+ "avatar_url": "https://avatars.githubusercontent.com/u/6746980?v=4",
36
+ "profile": "http://matt-graham.github.io",
37
+ "contributions": [
38
+ "bug",
39
+ "test",
40
+ "review",
41
+ "doc"
42
+ ]
43
+ },
44
+ {
45
+ "login": "kazewong",
46
+ "name": "Kaze Wong",
47
+ "avatar_url": "https://avatars.githubusercontent.com/u/8803931?v=4",
48
+ "profile": "https://www.kaze-wong.com/",
49
+ "contributions": [
50
+ "bug",
51
+ "blog",
52
+ "code",
53
+ "content",
54
+ "doc",
55
+ "example",
56
+ "infra",
57
+ "maintenance",
58
+ "research",
59
+ "review",
60
+ "test",
61
+ "tutorial"
62
+ ]
63
+ },
64
+ {
65
+ "login": "marylou-gabrie",
66
+ "name": "Marylou Gabrié",
67
+ "avatar_url": "https://avatars.githubusercontent.com/u/11092071?v=4",
68
+ "profile": "https://marylou-gabrie.github.io/",
69
+ "contributions": [
70
+ "bug",
71
+ "code",
72
+ "content",
73
+ "doc",
74
+ "example",
75
+ "maintenance",
76
+ "research",
77
+ "test",
78
+ "tutorial"
79
+ ]
80
+ },
81
+ {
82
+ "login": "Qazalbash",
83
+ "name": "Meesum Qazalbash",
84
+ "avatar_url": "https://avatars.githubusercontent.com/u/62182585?v=4",
85
+ "profile": "https://github.com/Qazalbash",
86
+ "contributions": [
87
+ "code",
88
+ "maintenance"
89
+ ]
90
+ },
91
+ {
92
+ "login": "thomasckng",
93
+ "name": "Thomas Ng",
94
+ "avatar_url": "https://avatars.githubusercontent.com/u/97585527?v=4",
95
+ "profile": "https://github.com/thomasckng",
96
+ "contributions": [
97
+ "code",
98
+ "maintenance"
99
+ ]
100
+ },
101
+ {
102
+ "login": "tedwards2412",
103
+ "name": "Thomas Edwards",
104
+ "avatar_url": "https://avatars.githubusercontent.com/u/6105841?v=4",
105
+ "profile": "https://github.com/tedwards2412",
106
+ "contributions": [
107
+ "bug",
108
+ "code"
109
+ ]
110
+ }
111
+ ],
112
+ "repoType": "github"
113
+ }
@@ -13,3 +13,6 @@ README.md
13
13
  *settings.json
14
14
  *build*
15
15
  test_docs/test_quickstart.ipynb
16
+ node_modules
17
+ package.json
18
+ yarn.lock
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flowMC
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: Normalizing flow exhanced sampler in jax
5
5
  Project-URL: Documentation, https://github.com/kazewong/flowMC
6
6
  Author: Marylou Gabrié, Dan Foreman-Mackey
@@ -66,6 +66,9 @@ Description-Content-Type: text/markdown
66
66
  </a>
67
67
  <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>
68
68
 
69
+ > [!WARNING]
70
+ > 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.
71
+
69
72
  ![flowMC_logo](./docs/logo_0810.png)
70
73
 
71
74
  flowMC is a Jax-based python package for normalizing-flow enhanced Markov chain Monte Carlo (MCMC) sampling.
@@ -163,4 +166,31 @@ This will help `flowMC` getting more recognition, and the main benefit *for you*
163
166
  > *Adaptive Monte Carlo augmented with normalizing flows.*
164
167
  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)
165
168
 
169
+ ## Contributors
170
+
171
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
172
+ <!-- prettier-ignore-start -->
173
+ <!-- markdownlint-disable -->
174
+ <table>
175
+ <tbody>
176
+ <tr>
177
+ <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>
178
+ <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>
179
+ <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>
180
+ <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>
181
+ <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>
182
+ <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>
183
+ <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>
184
+ </tr>
185
+ <tr>
186
+ <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>
187
+ </tr>
188
+ </tbody>
189
+ </table>
190
+
191
+ <!-- markdownlint-restore -->
192
+ <!-- prettier-ignore-end -->
193
+
194
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
195
+
166
196
 
flowmc-0.4.2/README.md ADDED
@@ -0,0 +1,140 @@
1
+ # flowMC
2
+
3
+ **Normalizing-flow enhanced sampling package for probabilistic inference**
4
+
5
+ <a href="https://flowmc.readthedocs.io/en/main/">
6
+ <img src="https://readthedocs.org/projects/flowmc/badge/?version=main&style=flat-square" alt="doc"/>
7
+ </a>
8
+ <a href="https://github.com/kazewong/flowMC/blob/Packaging/LICENSE">
9
+ <img src="https://img.shields.io/badge/License-MIT-blue?style=flat-square" alt="doc"/>
10
+ </a>
11
+ <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>
12
+
13
+ > [!WARNING]
14
+ > 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.
15
+
16
+ ![flowMC_logo](./docs/logo_0810.png)
17
+
18
+ flowMC is a Jax-based python package for normalizing-flow enhanced Markov chain Monte Carlo (MCMC) sampling.
19
+ The code is open source under MIT license, and it is under active development.
20
+
21
+ - Just-in-time compilation is supported.
22
+ - Native support for GPU acceleration.
23
+ - Suit for problems with multi-modality.
24
+ - Minimal tuning.
25
+
26
+ # Installation
27
+
28
+ The simplest way to install the package is to do it through pip
29
+
30
+ ```
31
+ pip install flowMC
32
+ ```
33
+
34
+ This will install the latest stable release and its dependencies.
35
+ flowMC is based on [Jax](https://github.com/google/jax) and [Equinox](https://github.com/patrick-kidger/equinox).
36
+ By default, installing flowMC will automatically install Jax and Equinox available on [PyPI](https://pypi.org).
37
+ Jax does not install GPU support by default.
38
+ If you want to use GPU with Jax, you need to install Jax with GPU support according to their document.
39
+ At the time of writing this documentation page, this is the command to install Jax with GPU support:
40
+
41
+ ```
42
+ pip install --upgrade "jax[cuda12_pip]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
43
+ ```
44
+
45
+ If you want to install the latest version of flowMC, you can clone this repo and install it locally:
46
+
47
+ ```
48
+ git clone https://github.com/kazewong/flowMC.git
49
+ cd flowMC
50
+ pip install -e .
51
+ ```
52
+
53
+ ## Requirements
54
+
55
+ Here is a list of packages we use in the main library
56
+
57
+ * Python 3.9+
58
+ * Jax
59
+ * Jaxlib
60
+ * equinox
61
+
62
+ To visualize the inference results in the examples, we requrie the following packages in addtion to the above:
63
+
64
+ * matplotlib
65
+ * corner
66
+ * arviz
67
+
68
+ 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.
69
+
70
+ # Attribution
71
+
72
+ If you used `flowMC` in your research, we would really appericiate it if you could at least cite the following papers:
73
+
74
+ ```
75
+ @article{Wong:2022xvh,
76
+ author = "Wong, Kaze W. k. and Gabri\'e, Marylou and Foreman-Mackey, Daniel",
77
+ title = "{flowMC: Normalizing flow enhanced sampling package for probabilistic inference in JAX}",
78
+ eprint = "2211.06397",
79
+ archivePrefix = "arXiv",
80
+ primaryClass = "astro-ph.IM",
81
+ doi = "10.21105/joss.05021",
82
+ journal = "J. Open Source Softw.",
83
+ volume = "8",
84
+ number = "83",
85
+ pages = "5021",
86
+ year = "2023"
87
+ }
88
+
89
+ @article{Gabrie:2021tlu,
90
+ author = "Gabri\'e, Marylou and Rotskoff, Grant M. and Vanden-Eijnden, Eric",
91
+ title = "{Adaptive Monte Carlo augmented with normalizing flows}",
92
+ eprint = "2105.12603",
93
+ archivePrefix = "arXiv",
94
+ primaryClass = "physics.data-an",
95
+ doi = "10.1073/pnas.2109420119",
96
+ journal = "Proc. Nat. Acad. Sci.",
97
+ volume = "119",
98
+ number = "10",
99
+ pages = "e2109420119",
100
+ year = "2022"
101
+ }
102
+ ```
103
+
104
+ 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.
105
+
106
+
107
+ `flowMC` is a Jax implementation of methods described in:
108
+ > *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)
109
+
110
+ > *Adaptive Monte Carlo augmented with normalizing flows.*
111
+ 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)
112
+
113
+ ## Contributors
114
+
115
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
116
+ <!-- prettier-ignore-start -->
117
+ <!-- markdownlint-disable -->
118
+ <table>
119
+ <tbody>
120
+ <tr>
121
+ <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>
122
+ <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>
123
+ <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>
124
+ <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>
125
+ <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>
126
+ <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>
127
+ <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>
128
+ </tr>
129
+ <tr>
130
+ <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>
131
+ </tr>
132
+ </tbody>
133
+ </table>
134
+
135
+ <!-- markdownlint-restore -->
136
+ <!-- prettier-ignore-end -->
137
+
138
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
139
+
140
+
@@ -31,6 +31,7 @@
31
31
  "import jax.numpy as jnp\n",
32
32
  "from flowMC.resource.local_kernel.Gaussian_random_walk import GaussianRandomWalk\n",
33
33
  "from flowMC.resource.buffers import Buffer\n",
34
+ "from flowMC.resource.logPDF import LogPDF\n",
34
35
  "from flowMC.strategy.optimization import AdamOptimization\n",
35
36
  "from flowMC.strategy.take_steps import TakeSerialSteps\n",
36
37
  "from flowMC.Sampler import Sampler\n",
@@ -82,16 +83,19 @@
82
83
  " \"log_prob\": log_prob,\n",
83
84
  " \"acceptance\": acceptance,\n",
84
85
  " \"RWMCMC\": RWMCMC_sampler,\n",
86
+ " \"logpdf\": LogPDF(target_log_prob, n_dims=n_dims),\n",
85
87
  "}\n",
86
88
  "\n",
87
89
  "# Defining strategy\n",
88
90
  "\n",
89
- "strategy = TakeSerialSteps(\n",
90
- " logpdf=target_log_prob,\n",
91
- " kernel_name=\"RWMCMC\",\n",
92
- " buffer_names=[\"positions\", \"log_prob\", \"acceptance\"],\n",
93
- " n_steps=n_steps,\n",
94
- ")\n",
91
+ "strategy = {\n",
92
+ " \"take_serial_step\": TakeSerialSteps(\n",
93
+ " logpdf_name=\"logpdf\",\n",
94
+ " kernel_name=\"RWMCMC\",\n",
95
+ " buffer_names=[\"positions\", \"log_prob\", \"acceptance\"],\n",
96
+ " n_steps=n_steps,\n",
97
+ " )\n",
98
+ "}\n",
95
99
  "\n",
96
100
  "# Initializing sampler\n",
97
101
  "\n",
@@ -100,7 +104,8 @@
100
104
  " n_chains=n_chains,\n",
101
105
  " rng_key=rng_key,\n",
102
106
  " resources=resource,\n",
103
- " strategies=[strategy],\n",
107
+ " strategies=strategy,\n",
108
+ " strategy_order=[\"take_serial_step\"],\n",
104
109
  ")"
105
110
  ]
106
111
  },
@@ -119,7 +124,7 @@
119
124
  {
120
125
  "data": {
121
126
  "text/plain": [
122
- "<matplotlib.colorbar.Colorbar at 0x7fc714262cf0>"
127
+ "<matplotlib.colorbar.Colorbar at 0x7f96b5f2f230>"
123
128
  ]
124
129
  },
125
130
  "execution_count": 3,
@@ -181,7 +186,7 @@
181
186
  {
182
187
  "data": {
183
188
  "text/plain": [
184
- "<matplotlib.collections.PathCollection at 0x7fc6f5f6bc50>"
189
+ "<matplotlib.collections.PathCollection at 0x7f96b55efed0>"
185
190
  ]
186
191
  },
187
192
  "execution_count": 4,
@@ -220,10 +225,11 @@
220
225
  " \"log_prob\": log_prob,\n",
221
226
  " \"acceptance\": acceptance,\n",
222
227
  " \"RWMCMC\": RWMCMC_sampler,\n",
228
+ " \"logpdf\": LogPDF(target_log_prob, n_dims=n_dims),\n",
223
229
  "}\n",
224
230
  "\n",
225
231
  "strategy = TakeSerialSteps(\n",
226
- " logpdf=target_log_prob,\n",
232
+ " logpdf_name=\"logpdf\",\n",
227
233
  " kernel_name=\"RWMCMC\",\n",
228
234
  " buffer_names=[\"positions\", \"log_prob\", \"acceptance\"],\n",
229
235
  " n_steps=n_steps,\n",
@@ -236,7 +242,11 @@
236
242
  " n_chains=n_chains,\n",
237
243
  " rng_key=rng_key,\n",
238
244
  " resources=resource,\n",
239
- " strategies=[adam_optimizer, strategy],\n",
245
+ " strategies={\n",
246
+ " \"take_serial_step\": strategy,\n",
247
+ " \"optimize\": adam_optimizer,\n",
248
+ " },\n",
249
+ " strategy_order=[\"optimize\", \"take_serial_step\"],\n",
240
250
  ")\n",
241
251
  "\n",
242
252
  "nf_sampler.sample(initial_position, {})\n",
@@ -275,7 +285,7 @@
275
285
  "name": "python",
276
286
  "nbconvert_exporter": "python",
277
287
  "pygments_lexer": "ipython3",
278
- "version": "3.13.2"
288
+ "version": "3.11.2"
279
289
  }
280
290
  },
281
291
  "nbformat": 4,