in course_v3, lesson 1, how to make an early stopping for learn.fit_one_cycle when the error_rate is low enough or just save the model of lowest error_rate ?
because i really dont know how many cycles( the parameter) i should use in the fit_one_cycle function… some times the epochs used is too many or too small that have missed the best one.
Do i need to write a callback function by myself ? How to implement that…
For reference, the SaveModelCallback will only save out the ‘best’ model, it will not stop the training cycle.
i.e. if you setup and run 20 epochs, and the best model is at epoch 17, training will continue until the full 20 regardless.
It sounds like you are looking for something that stops training when a criterion (accuracy, etc) is met but I’m not aware of anything like that already written - you’d have to setup a custom callback for it I think.
@franva - the above is what you’ll want to use then.
I’ve been meaning to add some improvements to SaveModelCallback so if I get time I’ll post those out for review when done and maybe see if I can make an example for EarlyStoppingCallback to improve the docs as well.
thanks for the link @muellerzr.
That is odd how it’s laid out (one without example that shows higher in search, another buried but with example)…but glad there is an actual example out there.