-
Notifications
You must be signed in to change notification settings - Fork 108
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
Adding Riemannian Manifold HMC #538
Conversation
Thanks @dfm!!! Super excited for this! |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #538 +/- ##
==========================================
- Coverage 99.05% 98.90% -0.15%
==========================================
Files 58 59 +1
Lines 2632 2738 +106
==========================================
+ Hits 2607 2708 +101
- Misses 25 30 +5 ☔ View full report in Codecov by Sentry. |
Nice work! I ported the algorithm from A Family of MCMC Methods on Implicitly Defined Manifolds to python using Jax and blackjax api with intention to make it a PR. Now I can see that I can build on top of this PR. @junpenglao is this something of interest for blackjax devs? |
Yes! Especially nice that you already see a path of building it on top of this PR! |
I think this is probably more or less ready to review now. Some open questions/to-dos that could be implemented here or in future PRs:
But either way, I'd love to hear any feedback about this implementation at this point, including from @krzysztofrusek to get a sense for if there would be any interface changes that would make your future PR more straightforward! |
Great abstraction, it will be super simple for me to use blackjax parts. I think I can implement it within your interface. The additional constrained function is needed in
|
Good point! In general, I think it might actually be better to abstract all the way to Hamiltonian rather than just the metric because it many cases where you might want to use RMHMC it would actually be more efficient to evaluate the log density and mass matrix together! Let me poke at that a little bit more. |
moving RMHMC to a separate submodule fixing parallel tests and improving kinetic energy interface Moving explicit leapfrog step to end of implicit midpoint lint fix explicit update; include logdet in kinetic energy lint
While waiting for this PR to be reviewed, I drafter CHMC in a separate repo. |
Hi @dfm, what is the status of the PR currently? |
@junpenglao — I've been on parental leave and I'm just catching up, so I don't have much to add here at the moment. I'm happy to revisit this implementation in the coming months or happy to hand it off to someone who is keen to take it over! |
Thanks Dan! Let me take a look and get back to you. |
@dfm I updated the PR to the main branch, and it is good to go now. Do you have other things you would like to add? |
Alright merging this as it is good to go - will follow up for feature improvement in Discussion and Issue. |
Thank you for the contribution @dfm !!! |
Thanks @junpenglao! Sorry for disappearing!! |
* Adding initial implementation of RMHMC moving RMHMC to a separate submodule fixing parallel tests and improving kinetic energy interface Moving explicit leapfrog step to end of implicit midpoint lint fix explicit update; include logdet in kinetic energy lint * implementing untested rmhmc turning criterion * implementing Metric type * adding test for integrating non-separable potential * add energy check in non-separable test * add test for riemannian metric * Fix typing * fix test --------- Co-authored-by: Junpeng Lao <[email protected]>
Close #283.
As suggested by @junpenglao over in dfm/rmhmc#1, I've started the skeleton of a RMHMC implementation.
It doesn't check all the boxes yet, and I'll need to keep working on it, but I wanted to open the draft since I'm about to go on leave and might not get to it soon :D
There are various open interface question so it's probably not worth reviewing in too much detail as yet!
Refs:
A few important guidelines and requirements before we can merge your PR:
main
commit;pre-commit
is installed and configured on your machine, and you ran it before opening the PR;Consider opening a Draft PR if your work is still in progress but you would like some feedback from other contributors.