aesara-devs / aehmc

An HMC/NUTS implementation in Aesara
MIT License
33 stars 6 forks source link

README example not working as expected. #49

Closed zoj613 closed 2 years ago

zoj613 commented 2 years ago

The readme example throws an exception on the latest version. It requires a missing positional argument step_size in the kernel function call.

Please provide a minimal, self-contained, and reproducible example.

Please provide the full traceback of any errors.

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-4acbdcf584da> in <module>
     16 # Build the transition kernel
     17 srng = RandomStream(seed=0)
---> 18 kernel = nuts.kernel(
     19     srng,
     20     logprob_fn,

TypeError: kernel() missing 1 required positional argument: 'step_size'

Please provide any additional information below.

Versions and main components

rlouf commented 2 years ago

Did you install aehmc via pip? If so can you try to see if the example works with the latest commit?

The kernel API has changed with ab5125 and there hasn't been a release since.

rlouf commented 2 years ago

@zoj613 did you try to run the example with the latest commit to see if that's the issue?

zoj613 commented 2 years ago

It works, I get 0.9300463205925347 as the printed output. i do get a

WARNING (aesara.scan.basic): When the number of steps is fixed and equal to 1, the provided stopping condition, Elemwise{eq,no_inplace}.0 is ignored
WARNING (aesara.scan.basic): When the number of steps is fixed and equal to 1, the provided stopping condition, Elemwise{eq,no_inplace}.0 is ignored

warning but im not sure how important it is.

rlouf commented 2 years ago

Getting fixed in aesara-devs/aesara#741