I’ve found that Flux provides early stop by using callbacks.
Despite of the instruction, it is not compatible with @epochs
in my case.
For example, codes looks like the following keep run the epochs loop.
valid_check = function()
valid_loss = loss(x_test', θ_test', V_test')
@show valid_loss
valid_loss < 0.1 && Flux.stop()
end
@epochs 10 Flux.train!(loss, Flux.params(m), data, opt, cb=Flux.throttle(valid_check, 1))
Anyone knows what I should do…?
5 posts - 3 participants