-
-
Notifications
You must be signed in to change notification settings - Fork 71
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 ChainRules.jl definitions #148
Comments
@YingboMa since you have ChainRules experience, could you take a crack at this? |
Yeah, I can take a crack after the break. |
What does "different choices" mean? As in multiple ways to compute the same pullback/pushforward ? |
Yes, with very different memory and performance characteristics. The way we handle it is that we have a keyword argument for what algorithm to use, then that drops down to a helper function to dispatch on it: So as long as kwargs are supported I think we're good? Forward sensitivities are harder. But I realized we cannot support all operations on the solution type, since |
Yeah, that will work. |
I'm not sure if we really need to formalise anything @oxinabox . I assume that the kwarg approach here is sufficient for your needs @ChrisRackauckas ? Maybe it would be sufficient to provide examples of this in the ChainRulesCore docs? Perhaps specify some conventions? |
This is sufficient for me, as long as I can do the same kind of style with a ChainRules.jl definition. |
Yeah -- I don't know how we would really stop you haha. |
Oh, I just didn't know I could do kwargs and splatting now. This is gonna be easy then. |
Yeah, I think that is a good idea. |
It should all be setup now. Can't really test it until an AD can use it though, but it's a start :) |
Check out this branch of Zygote, and comment out your ZygoteRules |
I'll wait until we can really add tests. But you know I'll be the first adopter of the final form :) |
Yeah, that's why I felt the need to set it up. I'm 90% sure that when an AD turns ChainRules on, it'll just work. There's a 10% chance of a typo, and handling the |
Just like the new Zygote
@adjoint
, we can define how to lowersolve
to different choices of forward mode and adjoint definitions. I might need help from @oxinabox here.The text was updated successfully, but these errors were encountered: