ManiMage.ai

0:00 / 2:48

The gradientslope grows up

CalculusStop 12 of 122:48

Two slopes stack into one arrow that points straight uphill. Flip it, and you have the engine of machine learning.

This opens up

Nothing yet. No lesson builds on this one so far.

See alsoHow the matrices get filled in

Transcript

It follows the voice. Click a sentence to jump there.

The derivative handles one input: a single curve, a single slope at every point. But a hillside takes two inputs — east and north — and a trail map draws it from above as contour rings, every point on a ring at the same height. Where the rings crowd together, the ground is steep. Drop a hiker onto the map: from where she stands, every direction of travel has its own steepness.

Freeze her at one spot. Step due east and measure the climb: the ground rises zero point eight meters for every meter of travel — one number. Step due north instead: zero point six — a second number. Two directions, two slopes, and an ordinary derivative hands you only one of them at a time.

Stack the two numbers into one arrow: zero point eight east, zero point six north. That arrow is the gradient. Its direction is the single steepest way up the hill, and its length says how steep that climb is. And it crosses every contour ring at a right angle — straight uphill, with no sideways drift.

Now flip the arrow. Minus the gradient points the exact opposite way: the steepest descent, the fastest way down. Give the walk somewhere to go — read the same rings as a bowl, so the center is the lowest point and downhill aims inward. Take one step along minus the gradient, measure the slope again, step again — and again. Near the bottom the bowl flattens: the gradient shrinks, every step shrinks with it, and the walker settles on the valley floor.

That walk is how a neural network learns. A network's answers are set by millions of internal dials called weights, and every setting of the dials gets a score: how wrong the answers are. Treat the score as height, and you have a landscape with one direction per dial. Training steps along minus the gradient, over and over, nudging every dial at once, and the wrongness slides downhill. That method is gradient descent.

So: one arrow that carries one slope for every direction. Follow it and you climb the fastest way up. Flip it and you hold the engine that trains every modern neural network, one downhill step at a time. The derivative measured a single road. The gradient reads the whole landscape. Same idea, grown up.