drugforge.ml.early_stopping.ThresholdEarlyStopping
- class drugforge.ml.early_stopping.ThresholdEarlyStopping(threshold, patience, burnin=0)[source]
Bases:
objectClass for handling early stopping in training based on whether loss has been below a certain threshold for some number of epochs.
- __init__(threshold, patience, burnin=0)[source]
- Parameters:
threshold (float) – Loss below which to stop model training
patience (ing) – Number of epochs to wait once loss has dipped below threshold to make sure it stays there
burnin (int, optional) – If given, ensure that at least this many epochs of training have been done before we stop
Methods
__init__(threshold, patience[, burnin])check(epoch, loss)Check if training should be stopped.