Merge pull request #681 from dellison/stopdoc
add Flux.stop to training docs
This commit is contained in:
commit
eeed8b24c3
@ -93,3 +93,11 @@ evalcb() = @show(loss(test_x, test_y))
|
|||||||
Flux.train!(objective, ps, data, opt,
|
Flux.train!(objective, ps, data, opt,
|
||||||
cb = throttle(evalcb, 5))
|
cb = throttle(evalcb, 5))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Calling `Flux.stop()` in a callback will exit the training loop early.
|
||||||
|
|
||||||
|
```julia
|
||||||
|
cb = function ()
|
||||||
|
accuracy() > 0.9 && Flux.stop()
|
||||||
|
end
|
||||||
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user