Flux.jl/src/optimise/train.jl

12 lines
210 B
Julia
Raw Normal View History

2017-08-24 10:42:29 +00:00
function train!(m, data, opt; epoch = 1)
for e in 1:epoch
epoch > 1 && info("Epoch $e")
for (x, y) in data
loss = m(x, y)
@show loss
back!(loss)
update!(opt)
end
end
end