Merge branch 'master' of github.com:MikeInnes/Flux.jl
This commit is contained in:
commit
120a6db2bb
@ -9,7 +9,7 @@ To actually train a model we need three things:
|
|||||||
With these we can call `Flux.train!`:
|
With these we can call `Flux.train!`:
|
||||||
|
|
||||||
```julia
|
```julia
|
||||||
Flux.train!(model, data, opt)
|
Flux.train!(modelLoss, data, opt)
|
||||||
```
|
```
|
||||||
|
|
||||||
There are plenty of examples in the [model zoo](https://github.com/FluxML/model-zoo).
|
There are plenty of examples in the [model zoo](https://github.com/FluxML/model-zoo).
|
||||||
|
@ -8,8 +8,8 @@ function train!(m, data, opt; cb = () -> ())
|
|||||||
cb = tocb(cb)
|
cb = tocb(cb)
|
||||||
@progress for x in data
|
@progress for x in data
|
||||||
l = m(x...)
|
l = m(x...)
|
||||||
isinf(l.data[]) && error("Inf")
|
isinf(l.data[]) && error("Loss is Inf")
|
||||||
isnan(l.data[]) && error("NaN")
|
isnan(l.data[]) && error("Loss is NaN")
|
||||||
back!(l)
|
back!(l)
|
||||||
opt()
|
opt()
|
||||||
cb()
|
cb()
|
||||||
|
Loading…
Reference in New Issue
Block a user