Skip to content

Commit 5e62649

Browse files
committed
move a sentence
1 parent 259e663 commit 5e62649

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/src/training/training.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ for data in train_set
2929
end
3030
```
3131

32-
It is important that every `update!` step receives a newly gradient computed gradient.
3332
This loop can also be written using the function [`train!`](@ref Flux.Train.train!),
3433
but it's helpful to undersand the pieces first:
3534

@@ -43,8 +42,8 @@ end
4342

4443
Fist recall from the section on [taking gradients](@ref man-taking-gradients) that
4544
`Flux.gradient(f, a, b)` always calls `f(a, b)`, and returns a tuple `(∂f_∂a, ∂f_∂b)`.
46-
In the code above, the function `f` is an anonymous function with one argument,
47-
created by the `do` block, hence `grads` is a tuple with one element.
45+
In the code above, the function `f` passed to `gradient` is an anonymous function with
46+
one argument, created by the `do` block, hence `grads` is a tuple with one element.
4847
Instead of a `do` block, we could have written:
4948

5049
```julia
@@ -58,6 +57,9 @@ structures are what Zygote calls "explicit" gradients.
5857
It is important that the execution of the model takes place inside the call to `gradient`,
5958
in order for the influence of the model's parameters to be observed by Zygote.
6059

60+
It is also important that every `update!` step receives a newly gradient computed gradient,
61+
as this will be change whenever the model's parameters are changed, and for each new data point.
62+
6163
!!! compat "Explicit vs implicit gradients"
6264
Flux ≤ 0.13 used Zygote's "implicit" mode, in which `gradient` takes a zero-argument function.
6365
It looks like this:

0 commit comments

Comments
 (0)