简体   繁体   English

Keras:监视val_loss以尽早停止-错误报告的问题

[英]Keras : Monitoring val_loss for early stopping- Issue with misreporting

estop = EarlyStopping(monitor='val_loss', patience=10)
checkpoint = ModelCheckpoint(filepath, monitor='val_loss', verbose=1, save_best_only=True, mode='max')
reduce_lr_loss = ReduceLROnPlateau(monitor='loss', factor=0.1, patience=2, verbose=1, epsilon=1e-4, mode='min')  
history = model.fit_generator(train_manager,validation_data=valid_manager,callbacks=[checkpoint,estop,reduce_lr_loss],use_multiprocessing=True,

                                 epochs=epochs, #steps_per_epoch = seq_len,

                                 verbose=1,
                              max_queue_size=15)

For the above code, the val_loss monitored is alleged to remain unchanged. 对于上面的代码,据称监视的val_loss保持不变。 Which is not the case. 事实并非如此。 Any ideas why this might be? 任何想法为什么会这样?

Epoch 1/20
5155/5155 [==============================] - 207s 40ms/step - loss: 6.3960 - acc: 0.0612 - val_loss: 6.3265 - val_acc: 0.0646

Epoch 00001: val_loss improved from -inf to 6.32651, saving model to weights-improvement-01.hdf5
Epoch 2/20
5155/5155 [==============================] - 207s 40ms/step - loss: 6.2359 - acc: 0.0680 - val_loss: 6.2394 - val_acc: 0.0682

Epoch 00002: val_loss did not improve from 6.32651
Epoch 3/20
5155/5155 [==============================] - 207s 40ms/step - loss: 6.1534 - acc: 0.0712 - val_loss: 6.1957 - val_acc: 0.0702

Epoch 00003: val_loss did not improve from 6.32651
Epoch 4/20
5155/5155 [==============================] - 206s 40ms/step - loss: 6.1023 - acc: 0.0732 - val_loss: 6.1722 - val_acc: 0.0710

Epoch 00004: val_loss did not improve from 6.32651
Epoch 5/20
5155/5155 [==============================] - 207s 40ms/step - loss: 6.0678 - acc: 0.0744 - val_loss: 6.1593 - val_acc: 0.0715

Epoch 00005: val_loss did not improve from 6.32651
Epoch 6/20
5155/5155 [==============================] - 206s 40ms/step - loss: 6.0431 - acc: 0.0752 - val_loss: 6.1525 - val_acc: 0.0720

Epoch 00006: val_loss did not improve from 6.32651
Epoch 7/20
2372/5155 [============>.................] - ETA: 1:32 - loss: 6.0147 - acc: 0.0762


+ Code
+ Markdown

您正在使用最小模式,这意味着当监视的数量停止减少时,lr将减少。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM