Callback
minnt.STOP_TRAINING
module-attribute
STOP_TRAINING = StopTraining()
A sentinel value that can be returned by a callback to stop training.
minnt.Callback
Bases: Protocol
__call__
__call__(
module: TrainableModule, epoch: int, logs: Logs
) -> Literal[STOP_TRAINING] | None
Represents a callback called after every training epoch.
If the callback returns minnt.STOP_TRAINING, the training stops.
Parameters:
-
module(TrainableModule) –the module being trained
-
epoch(int) –the current epoch number (starting from one)
-
logs(Logs) –a dictionary of current logs, with all values being evaluated to float; newly computed metrics can be added here
Returns:
minnt.STOP_TRAININGto stop the training,Noneto continue.