Get gradient and hessian of log likelihood function

Hello All,

I need to evaluate gradient and hessian of the log likelihood function for my research purposes. I am wondering is there a way I can do this in numpyro (or Pyro). This would be equivalent to model.compile_dlogp() and model.compile_d2logp() function in PyMC. I tried to search through the document of numpyro (and Pyro), but couldn’t find a way to get gradient. Please advise? Thanks for all the help!

Naively, I tried to use jax.grad and jax.vjp function on the eight_schools() example on numpyro home page. But it didn’t work :slight_smile: .

Hi @rkmalaiya, you can compute hessian of a Pyro model similar to what we did in AutoLaplaceApproximation.