Skip to content
ml-recall

#patience

3 questions from Learning Theory, Training Deep Networks

Timed test

3 questions · 3 min · score and explanations at the end

Take a test
Q 1 / 3Score 0 / 0

Question 1: Short answer

mediumAI-checkedLearning Theory

This loop implements early stopping with a patience criterion:

val_losses = [0.90, 0.70, 0.62, 0.60, 0.61, 0.598, 0.605, 0.603, 0.601, 0.59]
patience, min_delta = 3, 0.005
best, wait = float("inf"), 0
for epoch, loss in enumerate(val_losses, start=1):
    if loss < best - min_delta:
        best, wait = loss, 0
    else:
        wait += 1
        if wait >= patience:
            break
print(epoch, best)

Training stops after epoch , and best then holds the value .

Fill in every blank (hints in the boxes). Enter moves to the next blank.