change argument name for better clarity

This commit is contained in:
CarloLucibello 2017-10-11 13:18:50 +02:00 committed by Mike J Innes
parent 23674b2555
commit 6d3a2a2210

View File

@ -4,10 +4,10 @@ using Flux.Tracker: back!
tocb(f) = f
tocb(fs::AbstractVector) = () -> foreach(call, fs)
function train!(m, data, opt; cb = () -> ())
function train!(loss, data, opt; cb = () -> ())
cb = tocb(cb)
@progress for x in data
l = m(x...)
l = loss(x...)
isinf(l.data[]) && error("Loss is Inf")
isnan(l.data[]) && error("Loss is NaN")
back!(l)