-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Autodiff of quadgk
#73
Comments
Basically this needs to be done by writing ChainRules that tell Zygote how to differentiate integrals without differentiating through the (mutating) code. Fortunately, this has already been done — if you use https://github.com/SciML/Integrals.jl, then it provides a wrapper around QuadGK that provides the appropriate ChainRules. In the longer run it might be worth adding chain rules to QuadGK directly. |
Autodiff in Integrals.jl was recently fixed in this PR SciML/Integrals.jl#175 and it should be available in its next release. |
Thank you for a great package!
I would like to use Zygote on
quadgk
but below is a self-contained example, where it does not work becausequadgk
callssetindex!
. Can I do anything to work around this? I coded up a small example of differentiatingquadgk
of a constant function and it did work so it seems that there is hope for Zygote and QuadGK to play together nicely.The text was updated successfully, but these errors were encountered: