Merge branch 'master' of github.com:MikeInnes/Flux.jl

This commit is contained in:
Mike J Innes 2017-09-27 21:16:23 +01:00
commit 120a6db2bb
2 changed files with 3 additions and 3 deletions

View File

@ -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).

View File

@ -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()