Log inStart free
LESSON 4.55 · 5 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Bayesian optimization

Watch a surrogate model choose the next learning rate to try.


Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 4.55 · TUNING BAY6 TRIALS · BEST ERROR 0.225
01
Stage 1 of 5 · Costly trials
Each trial trains the model at one learning rate and reads its validation error. After 6 trials, the best error is 0.225.
Explain it simply

The dashed line is the true error for every learning rate. In real tuning you never see it. Each teal dot is one trial, and each trial costs a full training run. So the goal is to find the lowest point with as few trials as possible.

An error plot over learning rates from 0.0001 to 1 with 6 trial dots. The best trial is trial 6 at 0.00094 with error 0.225.

trialslearning rate, pick scoresurrogate μ ± 2σbest so farhidden error curve
0.000100.00100.0100.101.000.150.200.250.300.350.40learning rate (log scale) →validation errorhidden123456#learning rateerrorpick10.0110.330random20.710.357random30.0270.336random40.00400.303EI50.00200.257EI60.000940.225EIerror plottrial logbest so far y* = 0.225 (trial 6)0.000100.00100.0100.101.000.150.200.250.300.350.40learning rate (log scale) →validation errorhidden123456#learning rateerrorpick10.0110.330random20.710.357random30.0270.336random40.00400.303EI50.00200.257EI60.000940.225EIerror plottrial logbest so far y* = 0.225 (trial 6)
Toy: one learning rate, 0.0001 to 1; a made-up error curve
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
y=f(x)\sy{y}{data}{y} = f(\sy{x}{param}{x})
y6=f(0.00094)=0.225\sy{y}{data}{y_{6}} = f(\sy{x}{param}{0.00094}) = 0.225

Each trial reads the error f at one learning rate x.

Common mix-ups

MYTHAlways try the spot with the lowest predicted error.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01With EI and ℓ 0.5, which dip holds the best learning rate after 10 trials?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.