Multivariable Calculus
Real problems depend on many variables; a machine-learning model's error depends on thousands of parameters. Multivariable calculus extends derivatives to functions of several inputs, and its central tool, the gradient, is the engine behind modern machine learning.
A partial derivative measures the rate of change with respect to one variable while holding the others fixed. For , the partial is the ordinary derivative treating as a constant, and treats as constant. Each partial is a slope along one axis.
The gradient collects all partials into a vector: . It points in the direction of steepest increase of , and its magnitude is how steep that increase is. At a maximum or minimum, the gradient is the zero vector.
The Gradient & Descent
| Concept | Definition & Rule |
|---|---|
| Gradient | Points uphill toward steepest increase |
| Descent Step | Moves opposite to minimise |
| Zero Vector | Reached at local extrema () |
| Learning Rate | Size of the step taken each iteration |
This drives gradient descent, the workhorse optimisation algorithm: to minimise a function, repeatedly step in the direction opposite the gradient by a learning-rate amount until the gradient is near zero.
Pitfall: Differentiating with respect to the wrong variable, or forgetting that gradient descent moves opposite the gradient vector because the gradient points uphill.