more flexible training loop
This commit is contained in:
parent
c2db42d38e
commit
3f83be7bb7
@ -6,8 +6,8 @@ tocb(fs::AbstractVector) = () -> foreach(call, fs)
|
|||||||
|
|
||||||
function train!(m, data, opt; cb = () -> ())
|
function train!(m, data, opt; cb = () -> ())
|
||||||
cb = tocb(cb)
|
cb = tocb(cb)
|
||||||
@progress for (x, y) in data
|
@progress for x in data
|
||||||
back!(m(x, y))
|
back!(m(x...))
|
||||||
opt()
|
opt()
|
||||||
cb()
|
cb()
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user