Commit Graph

54 Commits

Author SHA1 Message Date
LamTrinh.Dev
b6239b8cee [docs] Update links to repositories moved to https://github.com/swiftlang/ 2024-07-22 12:22:43 -07:00
Philip Turner
993c5c4424 Update DifferentiableProgramming.md 2021-12-07 06:06:06 -05:00
Philip Turner
1a3a01c929 Update DifferentiableProgramming.md 2021-12-06 20:10:48 -05:00
swift-ci
632c5ca835 Merge pull request #40410 from philipturner/patch-3 2021-12-03 22:15:47 -08:00
Philip Turner
6cf5327348 Fix typo in Differentiable Programming Manifesto 2021-12-03 19:37:29 -05:00
Philip Turner
a79877c2e1 Fix typo in Differentiable Programming Manifesto 2021-12-03 19:26:29 -05:00
Richard Wei
0b53a02544 [AutoDiff] Rename 'in:' to 'of:' in differential operators.
Rename the argument label `in:` in `gradient(at:in:)`, `pullback(at:in:)`, etc to `of:`, as suggested in the [pitch thread](https://forums.swift.org/t/differentiable-programming-for-gradient-based-machine-learning/42147).
2021-02-24 01:33:42 -05:00
Richard Wei
8bc6143a4c [AutoDiff] Rename 'move(along:)' to 'move(by:)'.
Rename `move(along:)` to `move(by:)` based on the proposal feedback. The main argument for the change is that tangent vectors specify both a direction and a magnitude, whereas `along:` does not indicate that `self` is being moved by the specified magnitude.
2021-02-23 21:45:01 -05:00
Richard Wei
e3db926e0c [AutoDiff] Remove '_Differentiable.zeroTangentVectorInitializer'. (#35329)
Remove `_Differentiable.zeroTangentVectorInitializer` to address the feedback on the [proposal thread](https://forums.swift.org/t/differentiable-programming-for-gradient-based-machine-learning/42147). The corresponding change has already been made in the [proposal](https://github.com/rxwei/swift-evolution/blob/autodiff/proposals/0000-differentiable-programming.md).

Removed components:
- `zeroTangentVectorInitializer` and `zeroTangentVector` in `Differentiable`, `Array`, `Optional`, `Float`, `Double`, `Float80`, and SIMD types.
- `zeroTangentVectorInitializer` synthesis logic in `Differentiable` derived conformances.
2021-01-20 10:45:03 -08:00
Slava Pestov
c997016bc6 Update some docs to talk about 'main' instead of 'master'
Fixes https://bugs.swift.org/browse/SR-14015 / rdar://problem/72819056
2021-01-11 22:57:51 -05:00
Michelle Casbon
5598283257 Change tensorflow link to point to main 2020-12-03 20:03:04 +00:00
marcrasi
4e048bfc35 Merge pull request #34893 from marcrasi/make-it-automatically-inherit
inherit required protocols during TangentVector synthesis
2020-11-30 23:51:40 -08:00
Marc Rasi
249285044e update differentiable programming manifesto 2020-11-30 14:14:11 -08:00
Richard Wei
9947860b85 [AutoDiff] Update manifesto to link to the initial proposal. 2020-11-27 21:03:06 -08:00
Toan Nguyen
4b005c4a83 Fix typos in comments 2020-10-27 19:38:16 +07:00
Richard Wei
8df2d34603 Address review comment. 2020-09-14 12:45:22 -07:00
Richard Wei
4fe8dda893 [AutoDiff] [Docs] Clarify 'Differentiable' derived conformances conditions.
Clarify `Differentiable` derived conformances synthesis conditions.
2020-09-11 23:07:41 -07:00
Richard Wei
ab4cdc12dc [Docs] [AutoDiff] Improve wording in various places in the manifesto. 2020-08-07 15:42:24 -07:00
Dan Zheng
f3685f9a12 [AutoDiff] Conform Optional to Differentiable. (#32948)
Make `Optional` conditionally conform to `Differentiable` when the `Wrapped` type does.
`Optional.TangentVector` is a wrapper around `Wrapped.TangentVector?`.

Also, fix `Array.TangentVector.zeroTangentVectorInitializer`.

Resolves TF-1301.
2020-07-17 12:07:52 -07:00
Robert Widmann
cddf73ecdb [Gardening] Clean Up OS-Test Patterns Across The Codebase
Clean up a few general patterns that are now obviated by canImport

This aligns more generally with the cleanup that the Swift Package
Manager has already done in their automated XCTest-plumbing tool in
apple/swift-package-manager#1826.
2020-06-30 22:55:58 -07:00
Richard Wei
9964215bfe Update status to indicate feature gate 2020-06-29 20:25:39 -07:00
Dan Zheng
f9c5d7ae6c [AutoDiff] Derive Differentiable.zeroTangentVectorInitializer. (#31823)
`Differentiable` conformance derivation now supports
`Differentiable.zeroTangentVectorInitializer`.

There are two potential cases:
1. Memberwise derivation: done when `TangentVector` can be initialized memberwise.
2. `{ TangentVector.zero }` derivation: done as a fallback.

`zeroTangentVectorInitializer` is a closure that produces a zero tangent vector,
capturing minimal necessary information from `self`.

It is an instance property, unlike the static property `AdditiveArithmetic.zero`,
and should be used by the differentiation transform for correctness.

Remove `Differentiable.zeroTangentVectorInitializer` dummy default implementation.

Update stdlib `Differentiable` conformances and tests.
Clean up DerivedConformanceDifferentiable.cpp cruft.

Resolves TF-1007.
Progress towards TF-1008: differentiation correctness for projection operations.
2020-05-29 01:59:52 -07:00
Kshitij Patil
181477ffb2 Fix variable name in DifferentialProgramming.md
In Podcast Player example of Intelligent Systems, struct `Observation` has var `podcastState`, while it has been referenced as `state` in the following cell. Changed it to `podcastState`.
2020-05-03 23:40:33 +05:30
Richard Wei
dfb6f2078b [Docs] [AutoDiff] Allow implicitly inherited '@differentiable' on non-public declarations.
Currently, when a conforming type implements a `@differentiable` protocol requirement, the corresponding conforming implemnetation is required to have at least a `@differentiable` that covers all differentiability parameters in the protocol requirement.  However, this is not a great design for usability because developers almost always start with missing `@differentiable` and getting an compilation error.  This also makes ML models built with libraries that use differentiable programming more verbose than those built with other ML frameworks.

We agreed during this Friday's design review to allow `@differentiable` to be implicitly inherited from protocols when the conforming implementation is non-public.
2020-01-18 20:39:59 -08:00
swift-ci
1b0eee95e7 Merge pull request #28925 from apple/derivative-registration-typing-rules 2020-01-18 20:38:19 -08:00
Richard Wei
2a13bb0432 Remove duplicate paragraph. 2020-01-18 18:53:33 -08:00
Richard Wei
b5912e8267 Add missing 'T == T.TangentVector' requirement. 2020-01-18 18:50:50 -08:00
Richard Wei
893dd36327 Fix typo: 'foo' -> 'sinf' 2020-01-18 18:43:50 -08:00
Richard Wei
6df28a2816 Clarify the use of parameter indices and self. 2020-01-18 18:42:53 -08:00
Dan Zheng
d8d0f902fc [Docs] [AutoDiff] Fix typos in differentiable programming manifesto.
Add sections:
- Effect on ABI stability
- Effect on API resilience

These sections were incorrectly formatted when converting the doc to Markdown.
2020-01-13 06:53:38 -08:00
breandan
03fbf6598c Fix broken link 2019-12-30 06:38:02 -05:00
Richard Wei
a8e233fe47 [Docs] [AutoDiff] Add derivative/transpose registration typing rules. 2019-12-22 12:21:35 -08:00
swift-ci
9424f44ac8 Merge pull request #28768 from rxwei/correct-ad-builtins 2019-12-13 02:31:50 -08:00
Richard Wei
d4eb63fa03 [Docs] [AutoDiff] Correct AD builtins.
* `Builtin.autodiffApply*` has been renamed to `Builtin.applyDerivative*`.
  * The reason I'm not adding `_jvp` is because there will no longer be `_vjp`, which will make this suffix entirely unnecessary.
* The transpose application builtin is named `Builtin.applyTranspose*`.
2019-12-12 23:09:06 -08:00
Richard Wei
aa5ad262d6 Update docs/DifferentiableProgramming.md
Co-Authored-By: Bart Chrzaszcz <bart.chr@gmail.com>
2019-12-12 15:29:45 -08:00
Richard Wei
b40f076c1e Update docs/DifferentiableProgramming.md
Co-Authored-By: Bart Chrzaszcz <bart.chr@gmail.com>
2019-12-12 14:33:18 -08:00
Richard Wei
df68958ee8 Address review feedback. 2019-12-12 13:47:13 -08:00
Richard Wei
ec887ccdd7 Fix mis-reverted merge. 2019-12-12 13:38:39 -08:00
Richard Wei
e3b129efc7 Fix typo. 2019-12-12 13:37:48 -08:00
Richard Wei
be21aaf64b Merge branch 'master' of github.com:apple/swift into default-derivative 2019-12-12 13:36:31 -08:00
Richard Wei
f5d304c6ec [Docs] [AutoDiff] Add default derivative subsection and fix minor issues. 2019-12-12 13:33:10 -08:00
Dan Zheng
25bb2ca001 [Docs] [AutoDiff] Fix typos in differentiable programming manifesto.
- `@differential(linear)` -> `@differentiable(linear)`
- Fix derivative registration for `ElementaryFunctions` requirements.
2019-12-12 00:07:49 -08:00
Richard Wei
fb38f92eaa [Docs] [AutoDiff] Fix incorrectly rendered table and dead link 2019-12-11 15:16:17 -08:00
Richard Wei
e5935fba6c [Docs] [AutoDiff] Move higher-order functions out of future directions.
Differentiating higher-order functions is no longer a future direction, as the theory paper ([The Differentiable Curry](https://www.semanticscholar.org/paper/The-Differentiable-Curry-Plotkin-Brain/187078bfb159c78cc8c78c3bbe81a9176b3a6e02)) is now public.
2019-12-10 19:28:23 -08:00
Dan Zheng
51ebf99f5d [Docs] Fix typos in differentiable programming manifesto.
- Fix `Sequential` function builder usage.
- Fix grammatical error.
- `powerful machine learning` -> `expressive machine learning`
2019-12-02 12:39:50 -08:00
swift-ci
4c00d97b99 Merge pull request #28491 from dan-zheng/docs 2019-12-02 11:05:28 -08:00
Dan Zheng
292d76461a [Docs] Fix typos in differentiable programming manifesto.
- `Differentiable operators` -> `Differential operators`
- Fix incorrect `gradient(at:in:)` result type.
2019-11-26 18:15:56 -08:00
Richard Wei
7a9be4f09c Update markdown headers.
Co-Authored-By: Dan Zheng <danielzheng@google.com>
2019-11-22 23:06:46 -08:00
Richard Wei
ac16ac3b5a [Docs] [AutoDiff] Rename '@differentiating' and '@transposing' attributes.
In the code review for #28321, the main developers of AutoDiff agreed to rename `@differentiating` and `@transposing` to `@derivative(of:)` and `@transpose(of:)`, respectively.  This PR updates the manifesto to reflect this change.
2019-11-22 22:35:43 -08:00
Richard Wei
01b53db1b2 Remove a redundant paragraph. 2019-11-16 16:28:52 -08:00