Class EarlyStopping
Stop training when a monitored quantity has stopped improving.
Implements
Inherited Members
Namespace: Keras.Callbacks
Assembly: Keras.dll
Syntax
public class EarlyStopping : Callback, IDisposable
Constructors
| Improve this Doc View SourceEarlyStopping(String, Single, Int32, Int32, String, Nullable<Single>, Boolean)
Initializes a new instance of the EarlyStopping class.
Declaration
public EarlyStopping(string monitor = "val_loss", float min_delta = 0F, int patience = 0, int verbose = 0, string mode = "auto", float? baseline = default(float? ), bool restore_best_weights = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | monitor | quantity to be monitored. |
System.Single | 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. |
System.Int32 | patience | number of epochs with no improvement after which training will be stopped. |
System.Int32 | verbose | verbosity mode. |
System.String | mode | one of {auto, min, max}. In min mode, training will stop when the quantity monitored has stopped decreasing; in max mode it will stop when the quantity monitored has stopped increasing; in auto mode, the direction is automatically inferred from the name of the monitored quantity. |
System.Nullable<System.Single> | baseline | Baseline value for the monitored quantity to reach. Training will stop if the model doesn't show improvement over the baseline. |
System.Boolean | restore_best_weights | whether to restore model weights from the epoch with the best value of the monitored quantity. If False, the model weights obtained at the last step of training are used. |