-
Notifications
You must be signed in to change notification settings - Fork 17
Implement ADviaFDConfig #243
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #243 +/- ##
==========================================
+ Coverage 90.75% 91.15% +0.39%
==========================================
Files 11 12 +1
Lines 303 339 +36
==========================================
+ Hits 275 309 +34
- Misses 28 30 +2
Continue to review full report at Codecov.
|
oxinabox
left a comment
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 try and use a rrule/frule first then only fallback to using the FiniteDifferences if that returns nothing?
Do we ever want to avoid using the rule and make sure to use FD for the inner rule? I don't think so. I think this means we can just combine the |
Yeah, I guess so.
It is, because people use it directly. Don't they? |
oxinabox
left a comment
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.
merge when happy
| test_frule(config, outer, inner, rand(); frule_f=frule_via_ad, check_inferred=false) | ||
| end | ||
|
|
||
| @testset "Catch incorrect rules" begin |
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.
@oxinabox FYI there was actually a gross bug in the original implementation.
This TestConfig will be used to test rules for higher order functions f(inner, array) where we don't care that much for the rule for inner and want to do finite differencing for it out of convenience.
However, if we don't check whether a rule exists inside f/rrule_via_ad using the TestConfig, we are actually ignoring the outer rule implementation (for f) entirely, and always pass the tests because finite differencing is done on the outer rule 😅
I will wait for you to reply before merging since this was a significant development (even if not a significant change to the code)
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.
oh
Co-authored-by: Frames Catherine White <[email protected]>
Closes #241 and #221