Stopping learn.fit_one_cycle() when error gets low?

Hi,

I watched lesson 1, experimented with fit_one_cycle method, e.g. learn.fit_one_cycle(12)

is there a way to make the method call automatically stop the learning once my error_rate gets below certain threshold, e.g 0.05 ?

The EarlyStoppingCallback will stop for you when a metric stops improving.

Alternatively, the SaveModelCallback will save the best (but won’t stop early for you).

Neither of these does exactly what you want. But there is also no guarantee, in general, that the condition you’re describing will ever happen…