document epochs

This commit is contained in:
Mike J Innes 2018-02-16 11:23:23 +00:00
parent 5e861101f3
commit 1908b4f451
1 changed files with 16 additions and 0 deletions

View File

@ -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
```