Hamiltonian or NUT Sampler for ODE-based Models

Hi team,

I was looking for the samplers in the amazing ODE in PyMC notebook and wanted to check for Hamiltonian or NUT Sampler in these type of models.

However, when changing the step parameter to step=[pm.HamiltonianMC(vars_list)] or step=[pm.NUTS(vars_list)] in the sample function, a NotImplementedError gets raised

Is there another way to do HMC or NUTS on these models? Are there plans to implement the samplers for ODEs? Thank you in advance!

Which models are you implementing? Make sure you’re scrolling down to the 2nd half of the notebook, where it talks about “Bayesian Inference with Gradients”. The NotImplementedError is likely because the Ops used in the 1st half of the notebook don’t have analytical gradients.

Thank you! I must have missed that bit. I will try that out and open a new topic if that issue arise

1 Like