Early stopping using tensorflow tf.estimator ?

Viewed 1069

I am using tensorflow v1.4. I want to use early stopping using the validation set with a patience of 5 epochs.

I have searched on the web and found out that there used to be a function called ValidationMonitor but it is depreciated now. So is there a way to achieve this ?

2 Answers

Recently I have come across this function in tensorflow API. tf.keras.callbacks.EarlyStopping. tf version is r1.9.

Arguments:

  • monitor: quantity to be monitored
  • 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.
  • patience: number of epochs with no improvement after which training will be stopped.
  • verbose: verbosity mode.
  • 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.
Related