We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8f431e2 + b2ad834 commit c5a9714Copy full SHA for c5a9714
site/en/guide/migrate/early_stopping.ipynb
@@ -457,7 +457,7 @@
457
"epochs = 100\n",
458
"patience = 5\n",
459
"wait = 0\n",
460
- "best = 0\n",
+ "best = float('inf')\n",
461
"\n",
462
"for epoch in range(epochs):\n",
463
" print(\"\\nStart of epoch %d\" % (epoch,))\n",
@@ -486,7 +486,7 @@
486
" # The early stopping strategy: stop the training if `val_loss` does not\n",
487
" # decrease over a certain number of epochs.\n",
488
" wait += 1\n",
489
- " if val_loss > best:\n",
+ " if val_loss < best:\n",
490
" best = val_loss\n",
491
" wait = 0\n",
492
" if wait >= patience:\n",
0 commit comments