Machine learning

Stage 2 · Lesson 3 of 9

Derivatives and gradients

The maths you need

A tells you how fast a function's output changes when you nudge its input a little. For f(x) = x², the derivative is 2x. So at x = 3, a tiny increase in x raises f about six times as much.

A gradient is the same idea for a function with many inputs. It is a list of partial derivatives, one per input, and together they point in the direction where the output rises fastest. Training a model means adjusting its to make the , a score for how wrong it is, smaller.

The gradient of the loss for each weight says which way to move that weight and how strongly. Libraries work these out for you, so you rarely derive them by hand. But you must understand what a gradient means, or exploding and will make no sense later.

A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

Keep handy

Also worth your time

Mark this stage as not done?