cb convenience
This commit is contained in:
parent
e837bb0745
commit
aeaa138b6d
@ -1,7 +1,11 @@
|
||||
using Juno
|
||||
using Flux.Tracker: back!
|
||||
|
||||
tocb(f) = f
|
||||
tocb(fs::AbstractVector) = () -> foreach(call, fs)
|
||||
|
||||
function train!(m, data, opt; epoch = 1, cb = () -> ())
|
||||
cb = tocb(cb)
|
||||
@progress for e in 1:epoch
|
||||
epoch > 1 && info("Epoch $e")
|
||||
@progress for (x, y) in data
|
||||
|
Loading…
Reference in New Issue
Block a user