Depending on where a stopping criterion is placed in the tasks list (e.g. when it is the first being added to the trainer tasks), as soon as they raised the tasks placed after in the trainer tasks list are skipped.
There is three options I could see.
Set a flag whenever a TrainingExit is raised. Then at the end of the epoch, if such flag is set, the training stops.
Add a notion of task priority. By default, we could set a low priority for StoppingCriterion tasks, so they are executed at the end.
Leave it like that so it is more flexible. For some reasons someone might want to skip certain tasks when training stops. Note that this could also be achieved by option number 2 by manually changing the priority of the stopping criterion added to the trainer.
Depending on where a stopping criterion is placed in the tasks list (e.g. when it is the first being added to the trainer tasks), as soon as they raised the tasks placed after in the trainer tasks list are skipped.
There is three options I could see.