admin管理员组文章数量:1310466
I don't understand what the problem is. Yet, part of code which belong to early stopping, has problem to work properly. Let me share details.
early_stopping = EarlyStopping(monitor='val_loss',
min_delta=0.001,
patience=50,
verbose=1,
mode='min',
restore_best_weights=True)
This is my early stopping part of code. I want to add that I tried 20 for patience, to see changes, yet problem still went on.
Epoch 43/200
24/24 ━━━━━━━━━━━━━━━━━━━━ 0s 791us/step - loss: 0.5384 - val_loss: 0.0752
Epoch 44/200
24/24 ━━━━━━━━━━━━━━━━━━━━ 0s 788us/step - loss: 0.4744 - val_loss: 0.0836
Epoch 45/200
24/24 ━━━━━━━━━━━━━━━━━━━━ 0s 797us/step - loss: 0.4310 - val_loss: 0.0992
Epoch 46/200
24/24 ━━━━━━━━━━━━━━━━━━━━ 0s 788us/step - loss: 0.2604 - val_loss: 0.0942
Epoch 47/200
24/24 ━━━━━━━━━━━━━━━━━━━━ 0s 802us/step - loss: 0.4305 - val_loss: 0.1033
Epoch 48/200
24/24 ━━━━━━━━━━━━━━━━━━━━ 0s 782us/step - loss: 0.4294 - val_loss: 0.0960
Epoch 49/200
24/24 ━━━━━━━━━━━━━━━━━━━━ 0s 799us/step - loss: 0.4992 - val_loss: 0.0994
Epoch 50/200
24/24 ━━━━━━━━━━━━━━━━━━━━ 0s 797us/step - loss: 0.5215 - val_loss: 0.0966
Epoch 50: early stopping
Restoring model weights from the end of the best epoch: 1.
Here is the first epoch result:
Epoch 1/200
24/24 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - loss: 0.4989 - val_loss: 0.1611
Even though there is a better val_loss, the code automatically assumes the best epoch value is 1.
Normally my code does not work on a single result. The code works on 30 different targets. For the 1st target early stopping works correctly, but for the next ones there is a problem. But here is the strange thing; for example, it works correctly for the 1st target, the 2nd and 3rd ones are wrong, then it works correctly for the 4th target. How should I fix it?
I changed patience number. Also, I tried to add checkpoint to save manually. After that, I tried to upload again best epoch number to fix it. Yet, I did not succeeded it.( but this is another soultion type that I tried, it is not the main issue what I have)
本文标签: for loopEarly Stopping doesn39t work properlychoose wrong epochStack Overflow
版权声明:本文标题:for loop - Early Stopping doesn't work properly --- choose wrong epoch - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741800561a2398195.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论