-
Notifications
You must be signed in to change notification settings - Fork 89
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 rrule for map and expand the testing framework #56
Conversation
@@ -50,23 +50,58 @@ function rrule_test(f, ȳ, (x, x̄)::Tuple{Any, Any}; rtol=1e-9, atol=1e-9, fdm | |||
test_accumulation(Zero(), dx, ȳ, x̄_ad) | |||
end | |||
|
|||
function _make_fdm_call(fdm, f, ȳ, xs, ignores) |
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.
Eventually what this function does should be moved to FDM, but it took less time to write this than it would to figure out how to incorporate it into the FDM framework directly.
This implements `rrule(map, f, xs...)` and expands `rrule_test` to allow non-differentiable arguments. For such cases, the user need only pass `nothing` as the argument's assumed sensitivity.
In the interest of time and getting more stuff moved over from Nabla, I'm going to go ahead with this since it passes tests and is (now) pretty straightforward, plus nothing yet depends on ChainRules. Please feel free to open an issue about anything added here. |
This implements
rrule(map, f, xs...)
and expandsrrule_test
to allow non-differentiable arguments. For such cases, the user need only passnothing
as the argument's assumed sensitivity.Therrule
formap
is admittedly a little bizarre looking. It was ported from Nabla and attempts to use the same logic but stuffed awkwardly into the ChainRules framework.rrule
formap
requires that the mapped function have anrrule
defined for it.