machine-learning optimisation calculus
Definition
Gradient Descent
Gradient descent is a first-order gradient-based optimisation algorithm for minimising a differentiable objective
. Starting from an initial parameter vector , it repeatedly moves in the negative gradient direction: where
is the learning rate. Since points in the direction of steepest local increase, the vector points in the direction of steepest local decrease. In machine learning, is usually a loss function over model parameters.
Principle
The update is forced by the first-order local model of the objective. Near
To make this approximation smaller, choose
A useful equivalent view is that gradient descent chooses the step
Thus the algorithm is local: it trusts the current slope, but only within a radius controlled by
Algorithm
Gradient descent
Given a differentiable objective
, an initial point , and learning rates :
- compute the gradient
; - take the step
; - stop when the gradient, parameter change, or objective decrease is sufficiently small.
For empirical risk minimisation, full gradient descent computes the gradient using the whole training set at every step. stochastic gradient descent replaces this with a noisy gradient estimate from one example or a mini-batch.
Step size
The learning rate is the main control parameter.
- If
is too small, descent is stable but slow. - If
is too large, the method can overshoot, oscillate, or diverge. - If
decreases over time, early steps can move quickly while later steps refine the solution.
For an
So any fixed
Guarantees and limitations
For a convex function, every local minimum is global, so gradient descent can converge to a global minimiser under suitable smoothness and step-size assumptions. For a non-convex objective, the same update may converge to a local minimum, a saddle point, or a flat region.
Gradient descent also depends on scaling. If different coordinates of