change argument name for better clarity
This commit is contained in:
parent
23674b2555
commit
6d3a2a2210
@ -4,10 +4,10 @@ using Flux.Tracker: back!
|
|||||||
tocb(f) = f
|
tocb(f) = f
|
||||||
tocb(fs::AbstractVector) = () -> foreach(call, fs)
|
tocb(fs::AbstractVector) = () -> foreach(call, fs)
|
||||||
|
|
||||||
function train!(m, data, opt; cb = () -> ())
|
function train!(loss, data, opt; cb = () -> ())
|
||||||
cb = tocb(cb)
|
cb = tocb(cb)
|
||||||
@progress for x in data
|
@progress for x in data
|
||||||
l = m(x...)
|
l = loss(x...)
|
||||||
isinf(l.data[]) && error("Loss is Inf")
|
isinf(l.data[]) && error("Loss is Inf")
|
||||||
isnan(l.data[]) && error("Loss is NaN")
|
isnan(l.data[]) && error("Loss is NaN")
|
||||||
back!(l)
|
back!(l)
|
||||||
|
Loading…
Reference in New Issue
Block a user