Course map
Stage 1: Foundations
Stage 2: Machine Learning
Stage 3: Deep Learning
Stage 4: LLMs & Generative AI
Stage 5: Production & Specialization

Part 02 / Topic 3 of 7

Derivatives and gradients

The derivative of a function is its slope: how much the output changes per tiny change of input. For a function of many inputs, the gradient is the vector of all partial derivatives — it points in the direction of steepest increase.

Training a model means minimising a loss function, so we step against the gradient. That is gradient descent (Part 4). Everything a neural network learns, it learns from gradients.

For f(w) = (w·x − y)², the derivative with respect to w is 2(w·x − y)·x — the chain rule applied once (next section).

Done here? The practice set for Part 2 — 4 exercises with solutions — is on the part page.

Search the guide