2.6.14 · D1Model Evaluation & Selection

Foundations — Bayesian hyperparameter optimization

1,764 words8 min readBack to topic

Before you can read the parent note Bayesian hyperparameter optimization, you need to earn every symbol it throws at you. This page defines them one at a time, from absolute zero, in the order you must learn them. Nothing here assumes you've seen the notation before — line one starts from nothing.


0. The thing we are trying to do

A machine-learning model has knobs you set before training — how fast it learns, how much it distrusts complexity, and so on. These knobs are hyperparameters. Turning the knobs changes how well the trained model does on unseen data. We want the knob-setting that does best.


1. The symbol — one knob-setting

The picture: think of as a pin dropped on a map. One knob → the pin lives on a line. Two knobs → the pin lives on a flat sheet.

Why the topic needs it: the whole search happens on this map. Everything else is about deciding where on to drop the next pin.


2. The symbol — the hidden score-landscape

Because every setting has a score, we can imagine a landscape: over each point of the map there is a hill-height . The best setting is the top of the tallest hill.

Two more symbols travel with :


3. Noise: the symbol and why

When we train twice with the same we don't get exactly the same score — random shuffling, initialization, etc. wobble it. So the measured score is the true height plus a wobble:

Picture: is the true ground level; each measurement is a slightly jittered flag stuck near the ground. We only ever see the flags, never the ground itself.


4. Bell curves: , , ,

To reason about "how sure are we?" we need the shape of uncertainty: the bell curve (normal distribution).

Why the topic needs it: at every unseen setting the method reports its belief about as a bell curve — a best guess and an honesty band . That band is what makes exploration possible.


5. The two ready-made bell-curve tools: and

The Expected-Improvement formula in the parent note uses two functions of the standard bell curve (the one centred at with spread ).

Why the topic needs them: answers "what's the chance we beat the current best?" and measures "how big is the surprise if we do?" — the two ingredients of Expected Improvement.


6. Vectors and matrices: bold lists and grids

With many past trials we stack them.

Picture: a vector is a single shelf of boxes; a matrix is a whole cabinet of boxes with rows and columns. The GP posterior formulas multiply these to combine everything we've measured.


7. Subscripts and the data set


8. The surrogate and the acquisition function (names only, here)

Two big ideas the parent builds fully — here we just name the boxes so the symbols aren't mysterious:

The explore–exploit balance in one line:

  • Exploit = trust high (go where we already think it's good).
  • Explore = chase high (go where we're unsure — it might be secretly great).

This same tension is the heart of multi-armed bandits.


How the foundations feed the topic

Hyperparameter dial - lambda

Search space Lambda

Hidden score f of lambda

Noise epsilon gives y

Bell curve mu and sigma

Standard curve phi and Phi

Vectors and matrix K

Notebook D_n and best f-plus

Surrogate model M

Acquisition function alpha

Bayesian Optimization loop

Compare the naive alternatives that ignore the surrogate: Grid Search and Random Search. The grown-up version that searches over whole model designs is Neural Architecture Search.


Equipment checklist

Test yourself — say the answer out loud before revealing.

What does a single represent?
One complete choice of all hyperparameter knobs — a pin dropped on the search map.
What is the difference between and ?
gives the peak height; gives the peak location. We want the location.
Why is not the same as ?
; the measurement carries random noise , so we only see jittered flags, never the true ground.
In , what do and mean visually?
is the centre (peak) of the bell; is its width (uncertainty). Narrow = confident.
Little vs big ?
is the height of the standard bell; is the area (probability) to the left of .
What is ?
The best measured score in the notebook so far — the tallest flag planted.
What does measure?
Straight-line distance between two settings on the map; small = near-neighbour settings.
What are the two jobs of the acquisition function's ingredients and ?
drives exploitation (go where it looks good); drives exploration (go where we're unsure).
What does do?
It's the inverse matrix — the grid-level "undo" that lets the GP combine all past measurements.