0

我在 val_loss 中调节 earlystop,如下所示:

earlystop = EarlyStopping(monitor='val_loss',
                          min_delta=0.0001,
                          patience=3,
                          verbose=1,
                          mode='auto')

它在 3 个时期没有改善后正确停止,但我看不出它从哪里损失为 1.73011?任何人都可以帮忙吗?另请注意,即使在第一个 epoch 之后它也开始了,它不应该等待至少两个 epoch 进行比较然后声明“没有改进(减少)”损失吗?

训练过程时期

4

2 回答 2

0

这取决于您如何设置参数,您可以简单地增加 ,patience以便回调在停止训练过程之前观察更多时期的结果。

这些是每个参数的含义:


    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.
    baseline: Baseline value for the monitored quantity. Training will stop if the model doesn't show improvement over the baseline.
    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.

参考:https ://keras.io/api/callbacks/early_stopping/

于 2020-05-13T23:19:28.097 回答
0

当您没有明确提供基线时,似乎它正在使用一些默认基线值或计算基线(不知何故!)。

明确地使基线 = None并尝试。

于 2020-05-14T12:01:58.760 回答