bayes icon indicating copy to clipboard operation
bayes copied to clipboard

New window_adaptation syntax

Open forgi86 opened this issue 1 year ago • 4 comments

Hello, I an new to blackjax and recently came across your nice examples. However, I had to change a few line of codes to use recent versions of the jax/blackjax ecosystem, in particular the adaptation algorithm. For instance, in bayesian-neural-network.ipynb, I had to change the lines below the definition of the "potential" to:

warmup = blackjax.window_adaptation(blackjax.nuts, potential)
(state, parameters), _ = warmup.run(key_warmup, params)

kernel = blackjax.nuts(potential, **parameters).step
states = inference_loop(key_samples, kernel, state, num_steps)
sampled_params = states.position

forgi86 avatar Sep 17 '24 08:09 forgi86