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

FIX: window_adaptation usage aligned to blackjax 1.2.3 #3

Merged
merged 2 commits into from
Oct 2, 2024

Conversation

forgi86
Copy link
Contributor

@forgi86 forgi86 commented Sep 17, 2024

window_adaptation syntax has slightly changed and the current code does not work with blackjax 1.2.3

In bayesian-neural-network.ipynb, I replaced:

adapt = blackjax.window_adaptation(blackjax.nuts, potential, num_warmup)
final_state, kernel, _ = adapt.run(key_warmup, params)

with

adapt = blackjax.window_adaptation(blackjax.nuts, potential)
(state, parameters), _ = adapt.run(key_warmup, params, num_warmup)
kernel = blackjax.nuts(potential, **parameters).step

TODO: fix other examples accordingly

in bayesian-neural-network example: window_adaptation usage aligned to current version of blackjax (1.2.3)
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@gerdm gerdm self-assigned this Sep 18, 2024
- window_adaptation usage aligned to last version
- fixed arity bug in hbnn.py (wrong dimensionality of params_sigma_tree)
@gerdm
Copy link
Owner

gerdm commented Oct 2, 2024

Hi @forgi86, could you please share which version of Jax and Blackjax did you use for the refactor? I'm getting a

TypeError: clip() got an unexpected keyword argument 'max'

I have

blackjax==1.2.3
jax==0.4.26
jaxlib==0.4.26
jaxopt==0.8.3

It seems that the latest version of jax does not have a max argument for jax.numpy.clip

Thanks!

@forgi86
Copy link
Contributor Author

forgi86 commented Oct 2, 2024

blackjax==1.2.3
jax==0.4.33
jaxid==0.2
jaxlib==0.4.33
jaxopt==0.8.3
jaxtyping==0.2.34

@gerdm gerdm merged commit 9003260 into gerdm:main Oct 2, 2024
@gerdm gerdm mentioned this pull request Oct 2, 2024
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