The last chapter tuned one learning rate for one weight. Real models have many weights, one per feature — and if two features sit on wildly different scales, there may be no single learning rate that treats both of them fairly.
Two features, two weights, one shared learning rate — exactly like every gradient descent so far in this course, except now ranges across and ranges across . Step through learning rates and watch the faint curve (, the huge-scale feature) and the bold curve (, the tiny-scale feature) refuse to cooperate.
For linear regression, the curvature of the loss along each weight's axis scales with that feature's variance:
- — the loss function being minimized.
- — the weight (parameter) for feature .
- — the value of feature for training example .
- — index running over features.
- — index running over training examples.
- Curvature scales with the square of a feature's range
A feature on a 100x larger scale produces roughly more curvature along its own weight axis — small differences in scale become huge differences in curvature.
- One shared rate must satisfy the worst axis
A single learning rate must stay below everywhere to avoid diverging, so the large-scale feature forces the whole learning rate down — including for every feature that didn't need it to be that small.
Train on the raw features for 20 steps at the rate that's safe for the huge-scale feature, and has barely moved — its error is still nearly its full starting distance. Rescale down to 's range first, and the same learning rate that solved the tiny-scale weight now solves both weights exactly, in two steps instead of twenty.
, true weights , , with and :
- The same starting point, wildly different gradients
With four points : , , , , all predictions are at , so each residual is :
Over 66x steeper for , purely because 's values are 100x larger. The loss surface is a long, narrow valley: gentle along 's axis, brutally steep along 's.
- Safe for the steep axis, frozen on the gentle one
- is exactly the rate that lands on its true value in one step.
- Using that same rate for over 20 steps leaves it at just — still away from its true value of .
- Double the rate to and stops converging altogether, bouncing between and forever.
- Scaling turns two curvatures into one
Dividing by shrinks its range to match 's, and its true weight becomes . Both features now produce identical curvature. — the same "magic" rate from the last chapter — lands both and exactly, in a single step.
Find the learning rate that's safe for w2 but leaves w1 more than 2 away from its true value after the same 20 steps.
Grid search from the last chapter can find the best single learning rate, but it can't fix a loss surface shaped like a canyon — it can only pick the least-bad compromise. Standardizing every feature to a comparable scale before training removes the problem instead of compromising around it. This closes Model Evaluation & the Practical Workflow. The capstone puts every metric from this part — accuracy, F1, AUC, cross-validation, tuning, scaling — against one real pipeline at once.