Skip to content
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

Adjusted mclmc static #764

Closed

Conversation

reubenharry
Copy link
Contributor

@reubenharry reubenharry commented Jan 15, 2025

Dynamic and static adjusted mclmc

As with HMC, I separate (adjusted) MCLMC into static and dynamic variants, i.e. with and without randomized trajectory length.

I also changed for using sqrt_diag_cov to inverse_mass_matrix (i.e. the square of sqrt_diag_cov) because this is in keeping with the naming scheme for other algorithms. This requires a change in the adaptation scheme and the integrator, but a straightforward one.

This PR is motivated by an upcoming ensemble method.

A few important guidelines and requirements before we can merge your PR:

  • If I add a new sampler, there is an issue discussing it already;
  • We should be able to understand what the PR does from its title only;
  • There is a high-level description of the changes;
  • There are links to all the relevant issues, discussions and PRs;
  • The branch is rebased on the latest main commit;
  • Commit messages follow these guidelines;
  • The code respects the current naming conventions;
  • Docstrings follow the numpy style guide
  • pre-commit is installed and configured on your machine, and you ran it before opening the PR;
  • There are tests covering the changes;
  • The doc is up-to-date;
  • If I add a new sampler* I added/updated related examples

Consider opening a Draft PR if your work is still in progress but you would like some feedback from other contributors.

@junpenglao
Copy link
Member

Let me know when it is ready for review

@reubenharry reubenharry marked this pull request as ready for review January 19, 2025 02:49
@reubenharry
Copy link
Contributor Author

@junpenglao Should be ready. Tests seem to be taking a while - not sure why.

@junpenglao
Copy link
Member

Seems there are some tests fail

@reubenharry
Copy link
Contributor Author

Seems there are some tests fail

Hmm, it seems that tests/vi/test_schrodinger_follmer.py::SchrodingerFollmerTest::test_recover_posterior__with_pmap
times out? I'm a bit confused, since this test doesn't seem to involve mclmc or adjusted_mclmc, and I don't believe I made any other changes. Did @AdrienCorenflos write this test, and if so, any ideas?

@junpenglao
Copy link
Member

Let me rerun manually

@junpenglao
Copy link
Member

hmmm not sure why the test is getting hung up near the end, let me try to delete the cache.

@junpenglao
Copy link
Member

hmm same problem that test hang at 95-96%... the reason is not obvious to me. @reubenharry could you close this PR and start afresh? sorry about the trouble

@reubenharry
Copy link
Contributor Author

Sure, can do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants