-
Notifications
You must be signed in to change notification settings - Fork 2
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
add ChainRulesCore rules #3
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3 +/- ##
=======================================
Coverage 98.80% 98.80%
=======================================
Files 6 6
Lines 84 84
=======================================
Hits 83 83
Misses 1 1 Continue to review full report at Codecov.
|
I don't understand why the chain rule tests are failing. Let's look at the isotropic Gaussian PSF as an example Here is the definition of the gradient Lines 67 to 77 in 1b026c5
which I wrote out by hand and can be verified with this derivation http://umdberg.pbworks.com/w/page/88516931/Example%3A%20Gradient%20of%20a%20Gaussian here are the chain rules Lines 94 to 111 in 1b026c5
using them works as intended- using ChainRulescore, PSFModels
psf = PSFModels.Gaussian(fwhm=10)
point = [1, 2]
f, pullback = rrule(psf, point)
Δpsf, Δpoint = pullback(1.0)
f2, Δf = frule((Δpsf, Δpoint), psf, point)
# output
(0.8705505632961241, 0.7817442466933209) but using Lines 99 to 111 in 1b026c5
|
This PR adds analytical gradients using ChainRulesCore.jl