【问题标题】:What is Keras Early stopping looking atKeras Early 停止关注什么
【发布时间】:2020-08-30 08:01:57
【问题描述】:

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

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

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

Training Process Epochs

【问题讨论】:

    标签: keras early-stopping


    【解决方案1】:

    这取决于您设置参数的方式,您可以简单地增加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/

    【讨论】:

      【解决方案2】:

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

      明确地设置 baseline = None 并尝试。

      【讨论】:

        猜你喜欢
        • 2019-01-20
        • 2018-11-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-03-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多