As this thread, we can stop iteration loop by setting function (f:trainer -> bool) as Trainer's stop_triger. But in this way, I think we can't use other extension such as LogReport which use stop_trigger=((args.epoch, '10')).
So, my question is how to implement early stopping as the Extension and how to send a signal to stop trainer's iteration from Extension.
thanks.
I implemented the example code on gist, and updated the answer on the original thread.
I noticed that
stop_trigger
originally uses tuple notation like(args.epoch, '10')
, instead we need to change to pass a callable object (EarlyStoppingTrigger
in above example).