-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
1D example #57
Comments
You need to do |
I'll take a look at it. May not be until tomorrow though. |
Yes. B/c the gradient is computed as the integral of the vector of partials. Here
|
Oh hmm, it would be good to find an informative error message here, or break it apart on QuadGK |
@ChrisRackauckas @agerlach thanks a lot to help resolve this. I am actually trying to solve a Fredholm problem with differential programming. May I contact you separately if have questions? |
Yeah sure |
@ChrisRackauckas It appears this issue was fixed by #189 since we no longer use
I will follow up on this with a pr to run the existing AD tests on all the compatible algorithms, which would be helpful at catching edge cases. |
Awesome, really nice job on that update PR. Seems like it fixed most issues 😅 |
Hello,
great repo! I am trying to add one parameter to the 1D example, see self-explanatory code below
`using Quadrature, Cuba, Cubature, Zygote, FiniteDiff, ForwardDiff
using Test
One Dimensional
f(y,p) = sum(sin.(p[1].*y) + p[2])
lb = 1.0
ub = 3.0
p = [2.0,1.0]
prob = QuadratureProblem(f,lb,ub,p)
sol = solve(prob,QuadGKJL(),reltol=1e-3,abstol=1e-3)
function testf(lb,ub,p)
prob = QuadratureProblem(f,lb,ub,p)
solve(prob,QuadGKJL(),reltol=1e-3,abstol=1e-3)
end
dlb1,dub1,dp1 = Zygote.gradient(testf,lb,ub,p)`
However, I find the following error at the Zygote gradient call:
ERROR: Output should be scalar; gradients are not defined for output u: 1.31184143840124581
Also, is there any way to handle additional input parameters?
Thank you in advance.
The text was updated successfully, but these errors were encountered: