Skip to contents

early_stop() is a helper function to be supplied on early_stopping arguments.

Usage

early_stop(
  patience = 5L,
  min_delta = 1e-04,
  restore_best_weights = TRUE,
  monitor = "val_loss"
)

Arguments

patience

Integer. Epochs to wait after last improvement. Default 5.

min_delta

Numeric. Minimum improvement to qualify as better. Default 1e-4.

restore_best_weights

Logical. Restore weights from best epoch. Default TRUE.

monitor

Character. Metric to monitor. One of "val_loss" (default) or "train_loss".

Value

An object of class "early_stop_spec".

Examples

early_stop(patience = 10L, min_delta = 1e-3, monitor = "train_loss")
#> 
#> ── Early Stopping Spec 
#>  Monitor: train_loss
#>  Patience: 10
#>  Min delta: 0.001
#>  Restore best weights: TRUE