Checking your account

You can read the lesson while its saved answers and constructions load. Learning controls will open once that work is ready.

Does This Gradient Describe the Loss We Actually Run?

Checking the Derivative Against the Running Calculation

BOTIE

Training adjusts a model’s weights to reduce a chosen numerical measure of prediction error. We need to know how that measure changes as each weight moves; a derivative describes this local change. As neural networks gained more trainable weights, calculating those derivatives efficiently became essential. Rumelhart, Hinton and Williams’ 1986 paper showed how back-propagating errors could train internal representations. A sign or indexing mistake in that calculation can send later weight updates the wrong way.

Finite differences offer another route for a small check: move an input slightly, evaluate the function again and compare the change. This numerical approach predates modern automatic differentiation. It tests the running function rather than repeating the same derivative code, but its answer depends on the interval and on rounding in the two evaluations.

We will begin with a smoothly changing error measure, called a loss, then give the checker an absolute-error corner. The aim is to understand what a disagreement tells us before treating a neat matching number as proof that the derivative is correct.

Sources for this history