-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blackjax's Sequential Monte Carlo over PyMC models. #6989
Conversation
Sync forked repo
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6989 +/- ##
==========================================
- Coverage 87.78% 86.87% -0.91%
==========================================
Files 100 102 +2
Lines 16896 17017 +121
==========================================
- Hits 14832 14784 -48
- Misses 2064 2233 +169
|
model = fast_model() | ||
population = {"x": np.array([2, 3, 4])} | ||
blackjax_particles = blackjax_particles_from_pymc_population(model, population) | ||
chex.assert_trees_all_close(blackjax_particles, [np.array([[2], [3], [4]])]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think PyMC use chex - use jax.tree_map(np.testing.assert..., ...)
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like the dependency is transitive (pymc -> blackjax -> optax -> chex)
Can we add this to pymc-experimental first? |
Closing this one in favour of pymc-devs/pymc-extras#267 |
What is this PR about?
Allows to sample Pymc's models using Blackjax's Sequential Monte Carlo implementations. Apart from getting a Jax-based implementation for Blackjax, this PR allows for using HMC and NUTS as kernels, which aren't available in the existing PyMC implementation of SMC. Moreover, diagnosis are exposed and stored in the resulting arviz.InferenceData
Checklist
In order to sample using BJ SMC, we need
Major / Breaking Changes
None
New features
Bugfixes
Documentation
Maintenance
@junpenglao @aloctavodia