-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Support ChainRulesCore.Tangent? #20
Comments
This is something ChainRulesCore.jl has to do by calling cc @oxinabox |
This is where the NamedTuple versions make a lot more sense since those are implicitly functors themselves. Or at least have the same underlying tree as the original. |
This is the dual of FluxML/Zygote.jl#1042. One could imagine a |
I guess I should move this issue to ChainRulesCore - I thought it might be doable with some generic magic, like Functors does for some other things - if it needs a custom |
Moved to JuliaDiff/ChainRulesCore.jl#439 |
Well, since Tangent is a very generic container of sorts, one can imagine it does share the same representation of the tree as regular models would. That is, after all, its job. It may only have incomplete information because not all fields would have a corresponding bit in the Tangent, but that can be handled in the function doing the operation itself. At the very least, one would expect that all the leaves are present. We make use of the fact that the trees are similar to do structural optimisation in the upcoming DDP stuff too and that works with the way zygote returns the gradients just fine, so a tangent also ought to be able to. |
Just curious, what upcoming DDP stuff? |
If you call |
I realized that currently, Functors doesn't support ChainRulesCore.Tangent:
results in
Typical use cases of
Functors
will usually usere
ofx
instead ofdx
of course - still, it might be nice to supportfunctor
for tangents.The text was updated successfully, but these errors were encountered: