Early stopping

A callback for argus model train stop after a metric has stopped improving.

class argus.callbacks.EarlyStopping(monitor='val_loss', patience=1, better='auto')[source]

Stop the model training after its metric has stopped improving.

It is possible to monitor loss values during training as well as any metric available in the model State.

Parameters
  • monitor (str, optional) – Metric name to monitor. It should be prepended with val_ for the metric value on validation data and train_ for the metric value on the date from the train loader. A val_loader should be provided during the model fit to make it possible to monitor metrics start with val_. Defaults to val_loss.

  • patience (int, optional) – Number of training epochs without the metric improvement to stop training. Defaults to 1.

  • better (str, optional) – The metric improvement criterion. Should be ‘min’, ‘max’ or ‘auto’. ‘auto’ means the criterion should be taken from the metric itself, which is appropriate behavior in most cases. Defaults to ‘auto’.