来源:keras中文文档

1、EarlyStopping

from keras.callbacks import EarlyStopping, ModelCheckpoint(EarlyStopping, ModelCheckpoint介绍)

没有进步的轮数是指如果降到一定值时,如果之后有patience的值那么多轮数函数没有改进,那么停止训练。

2、ModelCheckpoint

keras.callbacks.ModelCheckpoint(filepath, monitor='val_loss', verbose=0, save_best_only=False, save_weights_only=False, mode='auto', period=1)

from keras.callbacks import EarlyStopping, ModelCheckpoint(EarlyStopping, ModelCheckpoint介绍)