Fix inner kernel tuning initialization for compatibility with persistent SMC#810
Open
thomasckng wants to merge 2 commits intoblackjax-devs:mainfrom
Open
Conversation
Member
|
Thank! could you fix the test? |
Author
|
@junpenglao Thank you for the review. The current test failures are caused by JAX v0.9.0+ issuing a Since addressing this warning (e.g., by adjusting the test configuration) is outside the scope of this change, I haven’t included a fix for it here. Please let me know whether you’d prefer to handle that fix in another PR, or if you’d like me to add it to this PR. |
Member
|
Ah i see, let me fix it upstream. |
Member
|
update: saw that optax has removed it google-deepmind/optax@df03db8, i will just wait for them to cut a new release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the
as_top_level_apifunction ininner_kernel_tuning.pyto properly initialize the SMC algorithm with all required parameters before accessing its.initmethod. This ensures compatibility with the persistent SMC algorithm (#799).Changes
init_fninas_top_level_apito instantiate thesmc_algorithmwith all parameters (logprior_fn,loglikelihood_fn,mcmc_step_fn,mcmc_init_fn,mcmc_parameters,resampling_fn,num_mcmc_steps, and extra parameters) before calling.initbuild_kernelfunction'sstep_fnMotivation
The previous implementation passed
smc_algorithm.initdirectly without initializing the algorithm object first. This worked for some SMC variants but breaks with persistent SMC, which requires the algorithm to be fully instantiated with its parameters before the init function can be accessed.Related Issues
Test
tests/smc/test_inner_kernel_tuning.pycover this functionality