uniport.model.utils.EarlyStopping

class uniport.model.utils.EarlyStopping(patience=10, verbose=False, checkpoint_file='')[source]

Early stops the training if loss doesn’t improve after a given patience.

__init__(patience=10, verbose=False, checkpoint_file='')[source]
Parameters:
  • patience – How long to wait after last time loss improved. Default: 30

  • verbose – If True, prints a message for each loss improvement. Default: False

Methods

__init__([patience, verbose, checkpoint_file])

param patience:

How long to wait after last time loss improved. Default: 30

save_checkpoint(loss, model)

Saves model when loss decrease.