document epochs
This commit is contained in:
parent
5e861101f3
commit
1908b4f451
|
@ -76,3 +76,19 @@ evalcb() = @show(loss(test_x, test_y))
|
|||
Flux.train!(objective, data, opt,
|
||||
cb = throttle(evalcb, 5))
|
||||
```
|
||||
|
||||
Note that, by default, `train!` only loops over the data once (a single "epoch").
|
||||
A convenient way to run multiple epochs from the REPL is provided by `@epochs`.
|
||||
|
||||
```julia
|
||||
julia> using Flux: @epochs
|
||||
|
||||
julia> @epochs 2 println("hello")
|
||||
INFO: Epoch 1
|
||||
hello
|
||||
INFO: Epoch 2
|
||||
hello
|
||||
|
||||
julia> @epochs 2 Flux.train!(...)
|
||||
# Train for two epochs
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue