-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Jacobian calculation for gradients #36
Comments
I am not entirely sure what you are asking for here. You have a transformation, you can also calculate its log Jacobian determinant, and you would like to use it for Bayesian inference?
Sorry, I am not getting this --- the Jacobian is for the whole transformation, not by coordinate. Perhaps a mock example would help. |
Sure. Suppose we have two random variables, Let I am interested in Right now, the examples in DynamicHMC do this by applying automatic differentiation to Does this example help? |
Yes, this is very helpful, and reminds me of something I encountered myself when I was coding a log density and its gradient without AD. I will think about it an get back to you in this issue. |
Cf tpapp/DynamicHMCExamples.jl#18 which is pretty much asking for the same thing. And I realized I need it too occasionally. It should be easy to implement, will start when #56 is merged. |
I'd like to use TransformVariables as part of an HMC sampler, but my evaluating my target distribution's probability density involves solving a partial differential equation, which is done outside Julia and thus not compatible with AutoDiff. There are a special techniques for obtaining gradients for such models which involve solving an adjoint equations, but that's a digression.
For people with use cases like mine, it would be nice if there was a function which for a transformation
y = t(x)
transformsgrad(log(f(x))
intograd(log(f(y))
with the appropriate Jacobian correction added to each individual coordinate - similar totransform_logdensity
, but for gradients of log-densities.The text was updated successfully, but these errors were encountered: