Awesome Testing

Learning lesson 04 · Walk downhill

How does a model decide which way to change millions of parameters?

examplepredictionlossgradientchanged parameters

01 · Smallest useful mechanism

The gradient describes the local uphill direction of the loss surface.

A model with two parameters can be pictured as a point above a loss landscape. Partial derivatives measure how loss changes when each parameter moves slightly. Together they form a gradient pointing toward steepest local increase. Subtracting it produces a downhill step. Repeating the calculation traces a path shaped by the data, surface, and learning rate.

Gradient descent subtracts a learning-rate-scaled gradient, trading step speed against the risk of oscillation or divergence.

02 · Experiment

Test the prediction

Exact regression objective · analytic and numerical gradients

A two-parameter model exposes its complete loss surface, update direction, and finite-difference verification.

Loading the learning experiment…

03 · Reason from evidence

Loss becomes NaN a few steps after the learning rate is increased tenfold.

Your brief: Design a minimal investigation that can distinguish a derivative bug from an unstable update and a numerically unsafe loss calculation.

Evidence your answer should use

  • An analytic-versus-finite-difference gradient check at a finite point
  • Loss, gradient norm, parameter norm, and update norm by step
  • The first operation that produces NaN or infinity
  • A rerun at the previous learning rate with the same batch and seed

There is no reveal button here. A strong response names the claim, the evidence that would test it, and what the evidence cannot establish.

Your learning artifact

Write the argument you would defend

Stored only in this browser. No account required; course reset does not delete it.

04 · Check your understanding

The weight gradient is negative. What does gradient descent do to that weight?

Optional referenceDeep dive / reference chapterOpen the complete essay, diagrams, mathematics, exercises, glossary, and sources when you want more depth.

Next: A shallow model has an easy derivative. Deep networks need an efficient way to reuse derivatives across many layers.