bayes icon indicating copy to clipboard operation
bayes copied to clipboard

FIX: window_adaptation usage aligned to blackjax 1.2.3

Open forgi86 opened this issue 1 year ago • 1 comments

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

forgi86 avatar Sep 17 '24 15:09 forgi86

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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!

gerdm avatar Oct 02 '24 10:10 gerdm

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

forgi86 avatar Oct 02 '24 14:10 forgi86