scalex.net.utils.EarlyStopping
- class scalex.net.utils.EarlyStopping(patience=10, verbose=False, checkpoint_file='')
Early stops the training if loss doesn’t improve after a given patience.
- __init__(patience=10, verbose=False, checkpoint_file='')
- Parameters:
patience – How long to wait after last time loss improved. Default: 10
verbose – If True, prints a message for each loss improvement. Default: False
Methods
__init__
([patience, verbose, checkpoint_file])- type patience:
save_checkpoint
(loss, model)Saves model when loss decrease.