Skip to content

Commit fcfd555

Browse files
authored
Merge pull request swiftlang#28522 from dan-zheng/docs
2 parents 8ac1f34 + 51ebf99 commit fcfd555

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

docs/DifferentiableProgramming.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ third-party libraries like [TensorFlow](https://github.com/tensorflow/swift).
174174
import TensorFlow
175175

176176
let model = Sequential {
177-
var layer1 = Dense<Float>(inputSize: 784, outputSize: 100, activation: relu)
178-
var layer2 = Dense<Float>(inputSize: 100, outputSize: 30, activation: relu)
179-
var layer3 = Dense<Float>(inputSize: 30, outputSize: 3, activation: identity)
177+
Dense<Float>(inputSize: 784, outputSize: 100, activation: relu)
178+
Dense<Float>(inputSize: 100, outputSize: 30, activation: relu)
179+
Dense<Float>(inputSize: 30, outputSize: 3, activation: identity)
180180
}
181181

182182
var classifier = Model()
@@ -238,12 +238,13 @@ Differentiation is the process of computing derivatives. See the
238238
["Math Introduction"](#math-introduction) section below for more details.
239239

240240
Derivatives are a fundamental tool in calculus and have applications in many
241-
domains, notably deep learning. Numerical computing in Swift is an expressive,
242-
high-performance language that is a great fit for numerical applications. Recent
243-
proposals have paved the way for low-level numerical computing in Swift:
244-
[AdditiveArithmetic][SE-0233], SIMD [[1][SE-0229]] [[2][SE-0251]], [generic math
245-
functions][SE-0246]. However, high-level numerical computing applications,
246-
including machine learning and artificial intelligence, require more work.
241+
domains, notably deep learning. As an expressive, high-performance language,
242+
Swift is a great fit for numerical applications. The [Swift Numerics
243+
library][swift-numerics] and recent Swift Evolution proposals have paved the way
244+
for low-level numerical computing in Swift: [AdditiveArithmetic][SE-0233], SIMD
245+
[[1][SE-0229]] [[2][SE-0251]], [generic math functions][SE-0246]. However,
246+
high-level numerical computing applications, including machine learning and
247+
artificial intelligence, require more work.
247248

248249
We believe that first-class differentiable programming is a big step towards
249250
high-level numerical computing support and will make Swift a real contender in
@@ -362,7 +363,7 @@ like Python: these languages are concise and easy to use. However, some people
362363
prefer safer programming: features like type checking and static diagnostics
363364
help catch errors early and improve productivity.
364365

365-
Differentiable programming in Swift enables safe, powerful machine learning.
366+
Differentiable programming in Swift enables safe, expressive machine learning.
366367
Custom differentiable data structures can be declared and checked at
367368
compile-time. Thanks to protocol-oriented programming, differentiable types are
368369
generalized by a protocol, enabling differential operators to be defined as
@@ -2640,6 +2641,8 @@ Parker Schuh, and Dimitrios Vytiniotis.
26402641
[Dan Zheng]: https://github.com/dan-zheng
26412642
[Marc Rasi]: https://github.com/marcrasi
26422643
[Bart Chrzaszcz]: https://github.com/bartchr808
2644+
2645+
[swift-numerics]: https://github.com/apple/swift-numerics
26432646
[SE-0229]: https://github.com/apple/swift-evolution/blob/master/proposals/0229-simd.md
26442647
[SE-0233]: https://github.com/apple/swift-evolution/blob/master/proposals/0233-additive-arithmetic-protocol.md
26452648
[SE-0246]: https://github.com/apple/swift-evolution/blob/master/proposals/0246-mathable.md

0 commit comments

Comments
 (0)