03

A landscape of choices

Two parameters choose the predictions. Their mean loss becomes the height of a surface.

Change the axes, keep the data

Return to our three fixed points and squared loss. Every pair (w,b)(w,b) defines a different line, three predictions, and one mean loss. Place ww on one horizontal axis and bb on the other. Put the resulting L(w,b)L(w,b) above that location. The collection of heights is a loss surface.

Expanding the three residuals and averaging their squares gives this exact expression for our invented example:

L(w,b)=23(w−2)2+(b−1)2L(w,b)=\frac{2}{3}(w-2)^2+(b-1)^2

The lowest point is (w,b)=(2,1)(w,b)=(2,1), where both squared terms vanish. This particular line passes through all three targets. The surface is an analytic calculation—not a measured neural-network landscape or a history of training.

Move the model, not just the camera

The 3D view makes both parameter directions visible. The linked 2D plot cuts through the same surface at the current bb, showing loss as ww varies. Use that flat slice and the numerical table for precise comparisons; depth and viewing angle can make heights harder to judge.

Changing a parameter recomputes the predictions and losses. Changing the view angle only rotates the projection: it cannot improve the model. The mesh samples the exact formula above, with a fixed height scale. These controls do not train a network.

EXP-001 · EXPLORE THE LANDSCAPE

Two parameters, one height.

Three invented points. Exact mean squared error. A sampled 3D projection—not a measured neural-network landscape.

Make a prediction first (optional)
If bias is fixed at 2, can weight alone make the loss zero?

FIG-003 · Height is loss; the two ground axes are model parameters.
Mean squared error over weight and biasInvented linear example. Selected weight 0.5, bias 2.5, mean loss 3.750. The highlighted surface curve holds bias fixed. Diamond marks weight2,bias1,loss0. View angle 45 degrees affects projection only.024-11336weight wbias bmean loss◇ minimum ● selected modelMean squared error over weight and biasInvented linear example. Selected weight 0.5, bias 2.5, mean loss 3.750. The highlighted surface curve holds bias fixed. Diamond marks weight2,bias1,loss0. View angle 45 degrees affects projection only.024-11336weight wbias bmean loss◇ minimum ● selected model

Mean squared error 3.750

THE SAME LANDSCAPE, SLICED FLAT

Hold bias fixed. Vary only weight.

A flat slice through the loss surfaceAt bias 2.5, the lowest loss in this slice is 2.250, at weight2. Selected weight0.5 gives mean loss3.750. Same loss scale in every state.024601234mean loss · bias held at 2.5weight wA flat slice through the loss surfaceAt bias 2.5, the lowest loss in this slice is 2.250, at weight2. Selected weight0.5 gives mean loss3.750. Same loss scale in every state.024601234mean loss · bias held at 2.5weight w

Weight 0.5, bias 2.5: mean loss 3.750. With this bias held fixed, the lowest possible loss is 2.250, at weight 2. View angle 45° changes only the projection.

Three invented examples · values rounded to three decimals
Point / xTarget yPredictionError eSquared e²
A / -1-12.0003.0009.000
B / 012.5001.5002.250
C / 133.0000.0000.000
Mean of the three squared errors3.750

The mesh samples a smooth mathematical surface. Perspective can obscure heights; the flat slice and numbers provide the exact reading. Heights use one fixed scale, 0 to 6.667, throughout this control window. No optimizer runs when you move a slider.

Compare three fixed states
Invented-data arithmetic; the camera cannot alter these values.
WeightBiasMean lossWhat changed?
0.52.53.750Starting model
22.52.250Best weight at this bias
210.000Both parameters fit the toy

The first move removes the weight error. The remaining bias error still costs 2.25. Only the final state fits all three points.

A slice has its own floor

At the defaults, w=0.5w=0.5 and b=2.5b=2.5, loss is 3.75. Change only ww to 2. Loss falls to 2.25, but stops short of zero: the remaining term is (2.5−1)2(2.5-1)^2. Then change bb to 1 and both terms disappear.

More generally, a fixed bias leaves a floor of (b−1)2(b-1)^2, reached at w=2w=2. Try a changed case: if you fix b=0b=0, what is the lowest loss achievable by varying weight?

Check the changed-bias case

The best weight is still w=2w=2, but the remaining bias term is (0−1)2=1(0-1)^2=1. The surface's global minimum and a slice's minimum are different ideas.

Where did the simple landscape formula come from?

Let a=w−2a=w-2 and d=b−1d=b-1. The three residuals become −a+d-a+d, dd, and a+da+d. Their cross terms cancel:

L=(−a+d)2+d2+(a+d)23=2a2+3d23\begin{aligned}L&=\frac{(-a+d)^2+d^2+(a+d)^2}{3}\\&=\frac{2a^2+3d^2}{3}\end{aligned}

This clean separation follows from these particular inputs and targets. It is not a formula for every regression dataset.

Our bowl has one minimum. Do not generalize its shape to neural networks: their objectives can be nonconvex, as discussed in Deep Learning, §8.2.2. Even on this simple surface, finding a direction and choosing how far to move are separate decisions.