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!`:
|
||||
|
||||
```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).
|
||||
|
@ -8,8 +8,8 @@ function train!(m, data, opt; cb = () -> ())
|
||||
cb = tocb(cb)
|
||||
@progress for x in data
|
||||
l = m(x...)
|
||||
isinf(l.data[]) && error("Inf")
|
||||
isnan(l.data[]) && error("NaN")
|
||||
isinf(l.data[]) && error("Loss is Inf")
|
||||
isnan(l.data[]) && error("Loss is NaN")
|
||||
back!(l)
|
||||
opt()
|
||||
cb()
|
||||
|
Loading…
Reference in New Issue
Block a user