Does EarlyStopping in Keras save the best model?

后端 未结 3 345
悲哀的现实
悲哀的现实 2021-01-18 05:48

When using something like:

callbacks = [
    EarlyStopping(patience=15, monitor=\'val_loss\', min_delta=0, mode=\'min\'),
    ModelCheckpoint(\'best-weights.         


        
3条回答
  •  生来不讨喜
    2021-01-18 06:32

    After the training stops by EarlyStopping callback, the current model may not be the best model with the highest/lowest monitored quantity. As a result a new argument, restore_best_weights, has been introduced in Keras 2.2.3 release for EarlyStopping callback if you would like to restore the best weights:

    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.

提交回复
热议问题