-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Use ChainRules types #603
Comments
Discussion @MikeInnes and I had today
|
Fwiw I think the concept of a AbstractGradient type, with ZeroGrad as an identity, sounds reasonable. This was the implicit definition of having nothing as a valid gradient, I feel. |
One important thing to do as part of this PR is to make sure to have a clean deprecation path, |
Advantages of this:
|
Another issue we should make sure is resolved by/when changing to ChainRules types: #802 |
This will give us more flexibility to implement internal changes such as #603 without changing the user-facing API.
This issue is about swapping Zygote over to use ChainRule's types by default.
When #366 is merged rules coming out of ChainRules will use its types like
Composite
andAbstractZero
,but thing created via Source Code Transform (SCT) will still use
NamedTuple
andnothing
.This is fine as they are mutually compatible because
accum
falls back to+
and ChainRules overloads+
.The use of Base types in Zygote tends to cause issues as its hard to add methods for
NamedTuple
andnothing
, due to type piracy.Especially things like defining linear operations on them (e.g. overloading things from LinearAlgebra), as well as defining addition
+
.Particular discussion on
Composite
ans structured differential types is in #462Related to:
#454 #419 #329
The text was updated successfully, but these errors were encountered: