Skip to content

Commit 3e6eee3

Browse files
authored
Merge pull request #139 from YingboMa/myb/docs
Fix a few spelling mistakes and formatting issues
2 parents 8c2d6cb + 132af40 commit 3e6eee3

File tree

1 file changed

+22
-27
lines changed

1 file changed

+22
-27
lines changed

docs/src/index.md

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ Almost always the _pushforward_/_pullback_ will be declared locally within the `
7474
##### Less formally
7575

7676
- The **pushforward** takes a wiggle in the _input space_, and tells what wobble you would create in the output space, by passing it through the function.
77-
- The **pullback** takes wobblyness information with respect to the function's output, and tells the equivalent wobblyness with repect to the functions input.
77+
- The **pullback** takes wobbliness information with respect to the function's output, and tells the equivalent wobbliness with respect to the functions input.
7878

7979
##### More formally
8080
The **pushforward** of ``f`` takes the _sensitivity_ of the input of ``f`` to a quantity, and gives the _sensitivity_ of the output of ``f`` to that quantity
8181
The **pullback** of ``f`` takes the _sensitivity_ of a quantity to the output of ``f``, and gives the _sensitivity_ of that quantity to the input of ``f``.
8282

8383
#### Math
84-
This is all a bit simplied by talking in 1D.
84+
This is all a bit simplified by talking in 1D.
8585

8686
##### Lighter Math
8787
For a chain of expressions:
@@ -91,30 +91,25 @@ b = g(a)
9191
c = h(b)
9292
```
9393

94-
The pullback of `g`, which incorperates the knowledge of `∂b/∂a`,
95-
applies the chainrule to go from `∂c/∂b` to `∂c/∂a`.
94+
The pullback of `g`, which incorporates the knowledge of `∂b/∂a`,
95+
applies the chain rule to go from `∂c/∂b` to `∂c/∂a`.
9696

97-
the pushforward of `g`, which also incorperates the knowledge of `∂b/∂a`,
98-
applies the chainrule to go from `∂a/∂x` to `∂b/∂x`.
97+
The pushforward of `g`, which also incorporates the knowledge of `∂b/∂a`,
98+
applies the chain rule to go from `∂a/∂x` to `∂b/∂x`.
9999

100100
#### Heavier Math
101-
If I have some functions: ``g(a)``, ``h(b)`` and ``f(x)=g(h(x))``,
102-
and I know the pullback of ``g``, at ``h(x)`` written: ``\mathrm{pullback}_{g(a)|a=h(x)}``,
101+
If I have some functions: ``g(a)``, ``h(b)`` and ``f(x)=g(h(x))``, and I know
102+
the pullback of ``g``, at ``h(x)`` written: ``\mathrm{pullback}_{g(a)|a=h(x)}``,
103+
and I know the derivative of ``h`` with respect to its input ``b`` at ``g(x)``,
104+
written: ``\left.\dfrac{∂h}{∂b}\right|_{b=g(x)}`` Then I can use the pullback to
105+
find: ``\dfrac{∂f}{∂x}``:
103106

104-
and I know the deriviative of h with respect to its input ``b`` at ``g(x)``, written:
105-
``\left.\dfrac{∂h}{∂b}\right|_{b=g(x)}``
107+
``\dfrac{∂f}{∂x}=\mathrm{\mathrm{pullback}_{g(a)|a=h(x)}}\left(\left.\dfrac{∂h}{∂b}\right|_{b=g(x)}\right).``
106108

107-
Then I can use the pullback to find: ``\dfrac{∂f}{∂x}``
108-
109-
``\dfrac{∂f}{∂x}=\mathrm{\mathrm{pullback}_{g(a)|a=h(x)}}\left(\left.\dfrac{∂h}{∂b}\right|_{b=g(x)}\right)``
110-
111-
112-
113-
If I know the deriviative of g with respect to its input a at x, written: ``\left.\dfrac{∂g}{∂a}\right|_{a=x}``
114-
115-
and I know the pushforward of ``h`` at ``g(x)`` written: ``\mathrm{pushforward}_{h(b)|b=g(x)}``
116-
117-
then I can use the pushforward to find ``\dfrac{∂f}{∂x}``
109+
If I know the derivative of ``g`` with respect to its input a at ``x``, written:
110+
``\left.\dfrac{∂g}{∂a}\right|_{a=x}``, and I know the pushforward of ``h`` at
111+
``g(x)`` written: ``\mathrm{pushforward}_{h(b)|b=g(x)}``. Then I can use the
112+
pushforward to find ``\dfrac{∂f}{∂x}``:
118113

119114
``\dfrac{∂f}{∂x}=\mathrm{pushforward}_{h(b)|b=g(x)}\left(\left.\dfrac{∂g}{∂a}\right|_{a=x}\right)``
120115

@@ -134,7 +129,7 @@ end
134129

135130
The input to the pushforward is often called the _perturbation_.
136131
If the function is `y = f(x)` often the pushforward will be written `ẏ = pushforward(ṡelf, ẋ)`.
137-
(`` is commonly used to represent the pertubation for `y`)
132+
(`` is commonly used to represent the perturbation for `y`)
138133

139134
!!! note
140135

@@ -421,18 +416,18 @@ As a notation that is the same across propagators, regardless of direction. (Inc
421416

422417

423418
### Why does `frule` and `rrule` return the function evaluation?
424-
You might wonder why `frule(f, x)` returns `f(x)` and the pushforward for `f` at `x`, and similarly for `rrule` returing `f(x)` and the pullback for `f` at `x`.
425-
Why not just return the pushforward/pullback, and let the user call `f(x)` to get the answer seperately?
419+
You might wonder why `frule(f, x)` returns `f(x)` and the pushforward for `f` at `x`, and similarly for `rrule` returning `f(x)` and the pullback for `f` at `x`.
420+
Why not just return the pushforward/pullback, and let the user call `f(x)` to get the answer separately?
426421

427422
There are two reasons the rules also calculate the `f(x)`.
428423
1. For some rules the output value is used in the definition of its propagator. For example `tan`.
429424
2. For some rules an alternative way of calculating `f(x)` can give the same answer while also generating intermediate values that can be used in the calculations within the propagator.
430425

431426
### Where are the gradients for keyword arguments?
432427
_pullbacks_ do not return a gradient for keyword arguments;
433-
similarly _pushfowards_ do not accept a pertubation for keyword arguments.
428+
similarly _pushfowards_ do not accept a perturbation for keyword arguments.
434429
This is because in practice functions are very rarely differentiable with respect to keyword arguments.
435-
As a rule keyword arguments tend to control side-effects, like logging verbsoity,
430+
As a rule keyword arguments tend to control side-effects, like logging verbosity,
436431
or to be functionality changing to perform a different operation, e.g. `dims=3`, and thus not differentiable.
437-
To the best of our knowledge no julia AD system, with support for the definition of custom primatives, supports differentating with respect to keyword arguments.
432+
To the best of our knowledge no Julia AD system, with support for the definition of custom primitives, supports differentiating with respect to keyword arguments.
438433
At some point in the future ChainRules may support these. Maybe.

0 commit comments

Comments
 (0)