Skip to content

Commit 48ababa

Browse files
More xrefs (#133)
* Add more xrefs * Fix some typos * Update docs/src/index.md Co-Authored-By: Lyndon White <oxinabox@ucc.asn.au> Co-authored-by: Lyndon White <oxinabox@ucc.asn.au>
1 parent cec2257 commit 48ababa

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

docs/src/index.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Knowing rules for more complicated functions speeds up the autodiff process as i
3333
!!! terminology "`frule` and `rrule`"
3434
`frule` and `rrule` are ChainRules specific terms.
3535
Their exact functioning is fairly ChainRules specific, though other tools have similar functions.
36-
The core notion is sometimes called _custom AD primitives_, _custom adjoints_, _custom_gradients_, _custom sensitivities_.
36+
The core notion is sometimes called _custom AD primitives_, _custom adjoints_, _custom gradients_, _custom sensitivities_.
3737

3838
The rules are encoded as `frule`s and `rrule`s, for use in forward-mode and reverse-mode differentiation respectively.
3939

@@ -63,7 +63,8 @@ end
6363
where again `y = foo(args; kwargs...)`,
6464
and `∂Y` is the result of propagating the derivative information forwards at that point.
6565
This propagation is call the pushforward.
66-
One could think of writing `∂Y = pushforward(Δself, Δargs)`, and often we will think of the `frule` as having the primal computation `y = foo(args...; kwargs...)`, and the push-forward `∂Y = pushforward(Δself, Δargs...)`
66+
Often we will think of the `frule` as having the primal computation `y = foo(args...; kwargs...)`, and the pushforward `∂Y = pushforward(Δself, Δargs...)`,
67+
even though they are not present in seperate forms in the code.
6768

6869

6970
!!! note "Why `rrule` returns a pullback but `frule` doesn't return a pushforward"
@@ -228,9 +229,9 @@ Similarly every `pullback` returns an extra `∂self`, which for things without
228229

229230
### Pullback/Pushforward and Directional Derivative/Gradient
230231

231-
The most trivial use of the `pushforward` from within `frule` is to calculate the directional derivative:
232+
The most trivial use of the `pushforward` from within `frule` is to calculate the [directional derivative](https://en.wikipedia.org/wiki/Directional_derivative):
232233

233-
If we would like to know the the directional derivative of `f` for an input change of `(1.5, 0.4, -1)`
234+
If we would like to know the directional derivative of `f` for an input change of `(1.5, 0.4, -1)`
234235

235236
```julia
236237
direction = (1.5, 0.4, -1) # (ȧ, ḃ, ċ)
@@ -244,7 +245,7 @@ y, ∂y_∂b = frule((Zero(), 0, 1, 0), f, a, b, c)
244245
y, ∂y_∂c = frule((Zero(), 0, 0, 1), f, a, b, c)
245246
```
246247

247-
Similarly, the most trivial use of `rrule` and returned `pullback` is to calculate the [Gradient](https://en.wikipedia.org/wiki/Gradient):
248+
Similarly, the most trivial use of `rrule` and returned `pullback` is to calculate the [gradient](https://en.wikipedia.org/wiki/Gradient):
248249

249250
```julia
250251
y, f_pullback = rrule(f, a, b, c)
@@ -259,20 +260,20 @@ And we thus have the partial derivatives ``\overline{\mathrm{self}}, = \dfrac{
259260
The values that come back from pullbacks or pushforwards are not always the same type as the input/outputs of the primal function.
260261
They are differentials, which correspond roughly to something able to represent the difference between two values of the primal types.
261262
A differential might be such a regular type, like a `Number`, or a `Matrix`, matching to the original type;
262-
or it might be one of the `AbstractDifferential` subtypes.
263+
or it might be one of the [`AbstractDifferential`](@ref ChainRulesCore.AbstractDifferential) subtypes.
263264

264265
Differentials support a number of operations.
265266
Most importantly: `+` and `*`, which let them act as mathematical objects.
266267

267268
The most important `AbstractDifferential`s when getting started are the ones about avoiding work:
268269

269-
- `Thunk`: this is a deferred computation. A thunk is a [word for a zero argument closure](https://en.wikipedia.org/wiki/Thunk). A computation wrapped in a `@thunk` doesn't get evaluated until `unthunk` is called on the thunk. `unthunk` is a no-op on non-thunked inputs.
270-
- `One`, `Zero`: There are special representations of `1` and `0`. They do great things around avoiding expanding `Thunks` in multiplication and (for `Zero`) addition.
270+
- [`Thunk`](@ref): this is a deferred computation. A thunk is a [word for a zero argument closure](https://en.wikipedia.org/wiki/Thunk). A computation wrapped in a `@thunk` doesn't get evaluated until [`unthunk`](@ref) is called on the thunk. `unthunk` is a no-op on non-thunked inputs.
271+
- [`One`](@ref), [`Zero`](@ref): There are special representations of `1` and `0`. They do great things around avoiding expanding `Thunks` in multiplication and (for `Zero`) addition.
271272

272273
### Other `AbstractDifferential`s:
273-
- `Composite{P}`: this is the differential for tuples and structs. Use it like a `Tuple` or `NamedTuple`. The type parameter `P` is for the primal type.
274-
- `DoesNotExist`: Zero-like, represents that the operation on this input is not differentiable. Its primal type is normally `Integer` or `Bool`.
275-
- `InplaceableThunk`: it is like a `Thunk` but it can do in-place `add!`.
274+
- [`Composite{P}`](@ref Composite): this is the differential for tuples and structs. Use it like a `Tuple` or `NamedTuple`. The type parameter `P` is for the primal type.
275+
- [`DoesNotExist`](@ref): Zero-like, represents that the operation on this input is not differentiable. Its primal type is normally `Integer` or `Bool`.
276+
- [`InplaceableThunk`](@ref): it is like a `Thunk` but it can do in-place `add!`.
276277

277278
-------------------------------
278279

0 commit comments

Comments
 (0)