more informative

This commit is contained in:
Mike J Innes 2017-09-27 18:33:23 +01:00
parent 96d1c55263
commit 94e38c05b8

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