-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
drop adjoints for [i,r,b]fft() #1386
drop adjoints for [i,r,b]fft() #1386
Conversation
Partially addresses FluxML#1377 ChainRules for these have been added in JuliaMath/AbstractFFTs.jl#58
I've made #83 to handle the chain rules issue you noted! |
Thanks! |
@@ -27,7 +27,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" | |||
ZygoteRules = "700de1a5-db45-46bc-99cf-38207098b444" | |||
|
|||
[compat] | |||
AbstractFFTs = "0.5, 1.0" | |||
AbstractFFTs = "1.3.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be done?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bumping the compat version of a dependency to add a new min bound? That's perfectly fine as long as we're not suddenly breaking anything. We do it all the time for e.g. Flux -> NNlib.
I think the build error is unrelated (and will be fixed by #1387 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests pass so LGTM. Thanks!
Co-authored-by: Brian Chen <[email protected]>
Following the discussion in #1377 I'm dropping the adjoints for
fft()
,ifft()
,rfft()
etc.since the rules for
rfft()
andirfft()
were not correct and correct rules have since been added toAbstractFFTs
in JuliaMath/AbstractFFTs.jl#58.Note that this does not yet fully fix the issue, since the adjoints for multiplication/left division by a real fft
AbstractFFTs.Plan
are still incorrect.There is an in-progress PR at
AbstractFFTs
to provide ChainRules for these:JuliaMath/AbstractFFTs.jl#67
For now, the adjoints for multiplication/left divison by
AbstractFFTs.Plan
are kept, even though they lead to incorrect results for real forward and inverse ffts.Note though that if the
dims
argument is not provided tofft()
etc., the rules provided by JuliaMath/AbstractFFTs.jl#58 aren't actually hit, and the compilation will fail trying to differentiate a try/except block inAbstractFFTs.plan_fft()
This is still better than a silently incorrect result as in
rfft()
andirfft()
, but a regression forfft()
etc. (without thedims
argument) where the rules defined in Zygote were seemingly correct.(which is why I made this a draft. Opinions on this welcome!)
PR Checklist
[ ] Documentation, if applicable