-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[AutoDiff] Deprecate Differentiable.AllDifferentiableVariables
.
#26527
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
[AutoDiff] Deprecate Differentiable.AllDifferentiableVariables
.
#26527
Conversation
Deprecate the `AllDifferentiableVariables` associated type and `var allDifferentiableVariables` property of the `Differentiable` protocol. `AllDifferentiableVariables` is not essential for differentiable programming and was added as a workaround to enable key-path-based machine learning optimizers: let parameters and gradients have same type (`AllDifferentiableVariables == TangentVector`) to enable joint key-path iteration. It is possible to implement key-path-based machine learning optimizers via other means (do key-path-based operations on `TangentVector`, then call `Differentiable.move(along:)` to perform update), so `AllDifferentiableVariables` is no longer necessary. Resolves TF-707.
1cda283
to
e3cc71f
Compare
caf0769
to
36c5fcd
Compare
@@ -1952,26 +1952,6 @@ extension Array where Element : Differentiable { | |||
|
|||
public typealias TangentVector = | |||
Array<Element.TangentVector>.DifferentiableView | |||
public typealias AllDifferentiableVariables = |
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.
In a separate patch, Array.DifferentiableView
should be replaced with a struct TangentVector
as described in the design overview.
@swift-ci Please clean test tensorflow |
CI weirdly fails with:
But I'm not able to reproduce this error locally. I'll break up the expression into two subexpressions nonetheless and try again. |
- Remove remaining `var allDifferentiableVariables` references. - Update checkout for tensorflow-swift-apis to fix compilation.
@swift-ci Please clean test tensorflow |
Oops, I missed failing
Will fix tomorrow. |
Add todo comment for TF-632: remove ad-hoc conformance logic for `TangentVector` when synthesized member types can be extended.
@swift-ci Please test tensorflow |
Note: tensorflow/swift-models and https://github.com./fastai/fastai_dev/tree/master/swift likely need to be updated. |
…es`. (swiftlang#26527)" This reverts commit 2e582b9.
`Differentiable.allDifferentiableVariables` deprecated in v0.5: swiftlang/swift#26527.
Deprecate the
AllDifferentiableVariables
associated type of theDifferentiable
protocol.AllDifferentiableVariables
is not essential for differentiableprogramming and was added as a workaround to enable key-path-based
machine learning optimizers: let parameters and gradients have the same type
(
AllDifferentiableVariables == TangentVector
) to enable joint key-pathiteration.
It is possible to implement key-path-based machine learning optimizers
via other means (do key-path-based operations on
TangentVector
, thencall
Differentiable.move(along:)
to perform update), soAllDifferentiableVariables
is no longer necessary.Simplified
Differentiable
protocol:Resolves TF-707.