Skip to content
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

Fall back on AD? #10

Open
cscherrer opened this issue Sep 14, 2022 · 1 comment
Open

Fall back on AD? #10

cscherrer opened this issue Sep 14, 2022 · 1 comment

Comments

@cscherrer
Copy link

This bit me today:

julia> with_logabsdet_jacobian(cbrt, 2.0)
NoLogAbsDetJacobian{typeof(cbrt), Float64}()

I could add a method for this, but there are so many other functions out there, maybe this could be automated?

This seems possible, since it's invertible:

julia> inverse(cbrt)
(::Base.Fix2{typeof(^), Int64}) (generic function with 1 method)

and AD-friendly:

julia> ForwardDiff.derivative(cbrt, 2.0)
0.2099868416491455
@oschulz
Copy link
Collaborator

oschulz commented Sep 14, 2022

maybe this could be automated

I don't think so (without heavy dependencies). But since inverse is already specialized for it we should specialize with_logabsdet_jacobian for it as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants