EarlyStopping#
- class pinnx.callbacks.EarlyStopping(min_delta=0, patience=0, baseline=None, monitor='loss_train', start_from_epoch=0)[source]#
Stop training when a monitored quantity (training or testing loss) has stopped improving. Only checked at validation step according to
display_everyinTrainer.train.- Parameters:
min_delta – Minimum change in the monitored quantity to qualify as an improvement, i.e. an absolute change of less than min_delta, will count as no improvement.
patience – Number of epochs with no improvement after which training will be stopped.
baseline – Baseline value for the monitored quantity to reach. Training will stop if the trainer doesn’t show improvement over the baseline.
monitor – The loss function that is monitored. Either ‘loss_train’ or ‘loss_test’
start_from_epoch – Number of epochs to wait before starting to monitor improvement. This allows for a warm-up period in which no improvement is expected and thus training will not be stopped.