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 = () -> ())
|
||||
cb = tocb(cb)
|
||||
@progress for (x, y) in data
|
||||
back!(m(x, y))
|
||||
@progress for x in data
|
||||
back!(m(x...))
|
||||
opt()
|
||||
cb()
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user