-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Cannot differentiate through cuhre
. Explicit type inference
#28
Comments
Found way out (not solution, unfortunately) checking references at your README (thanks) using ForwardDiff
using HCubature
b(cosθ,ϕ,c) = c[1]*cosθ*sin(ϕ) + c[2]*cosθ^2*cos(ϕ)^2
f(c) = hcubature(x->b(x[1],x[2],c), [-1.0,-π], [1.0,π])[1]
ForwardDiff.gradient(f, [1.1,1.1]) I am curious still if it is in principle possible to |
Ah, it seems that I still need
with Cuba.jl:
|
I'm not entirely sure, but I fear not 😞 I'd have suggested you to use a pure-Julia library like |
If we are sure that there are no tricks to pull It seems to me that it is not possible, running the same code on different types is one of the main advantages of julia. It does not work so naturally with external calls. |
Honestly I don't think there is anything we can do here in terms of automatic differentiation, so I'm going to close this issue. PS: the Cuba library is written in C, not C++ 😉 |
I copy here the reply of @simeonschaub on discourse for completeness.
|
I love the library and I don't any other better way in Julia to do >1 dim integrals.
Just discovered an issed trying calculate gradient of the integrated function
giving the error
most likely at
dointegral
functionCuba.jl/src/Cuba.jl
Line 181 in 3681ed8
Interestingly a gradient of 1dim integral taken with QuadGK works (well, native Julia).
The text was updated successfully, but these errors were encountered: