-
Notifications
You must be signed in to change notification settings - Fork 107
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
SMC-MCMC integration test, plus fixes. #522
Conversation
Codecov Report
@@ Coverage Diff @@
## main #522 +/- ##
=======================================
Coverage 99.28% 99.28%
=======================================
Files 47 47
Lines 1948 1948
=======================================
Hits 1934 1934
Misses 14 14
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
The changes to the random walk algorithms look fine to me. Only test_kernel_compatibility.py
seems frivolous, we are simply checking that the low level kernel function has a certain order in its inputs: kernel(key, state, logprob_fn, *kernel_params)
. Feels like more tests simply to check this are unnecessary, @junpenglao @rlouf thoughts?
Although the fix was indeed changing the order of the inputs, this test is checking that a step SMC step can be run with certain MCMC inner kernel. That implies correct order of inputs, but also that the output of the inner kernel has certain structure (for example, returns The point is that before this PR we were able to break the integration between MCMC and SMC, and no test would complain. By adding this test we are including a 'safety net' that alerts the developer that a new change is breaking. The fact that the test is simple is actually a feature, not a bug, since it will be very clear from the test output which regression was included. |
But the developer of a new algorithm would still need to manually add a test that checks for this, its not done automatically. For example NUTS, MALA, MGrad, GHMC, elliptical slice are not checked by this safety net, could still break it. I see your point though, maybe we can add support (in the test) for NUTS and MALA and use this as a safety net for the popular algorithms. |
Yes, new algorithms need to be added as they are coded. Only if we expect the user to be able to use them within SMC, it would be part of correctly testing the new algorithm.
Added NUTS and MALA |
* fixing interfaces, including test * improving test speed, fixing other tests * adding mala and nuts to SMC-MCMC integration test
Thank you for opening a PR!
Some kernel interfaces weren't compatible with SMC. This PR fixes them and adds a test that protects us from regressions that may break the integration between the MCMC kernels and SMC. If we believe a kernel could be used within SMC, then it should be added to this test.