Gradient Descent

Gradient Descent is an optimization method used to minimize an objective (loss) function by iteratively updating model parameters in the opposite direction of the gradient. It serves as the core algorithm of modern machine learning, underlying methods from linear regression to deep neural networks, as those methods have non-linear or non-convex loss functions that do not yield a closed-form solution.

Gradient descent finds the parameter vector that minimizes a differentiable loss function , such that the objective function is

Simple gradient descent updates iteratively using the batch gradient descent algorithm, which begins at an arbitrary estimate and updates at each time step :

where is the learning rate hyperparameter that controls step size, and is the gradient of (indicating the direction of steepest increase of the loss function). Moving in the opposite direction of the gradient reduces the function value.

Batch gradient descent terminates when it has converged, i.e., when . A maximum iteration size is also usually specified in the case that the algorithm does not converge.

However, over-reliance on can lead to oscillations () or slow convergence (). As such, we introduce momentum, which picks up speed along the direction of repeated updates, decreasing the effective learning rate to stabilize gradient descent. We define velocity with a momentum hyperparameter ,

such that the update rule becomes Note that since there is no momentum at time step , it follows that .

Convergence gradient descent is guaranteed to converge to the global minimum for convex loss functions, provided that the learning rate (and other hyperparameters) are chosen appropriately.

Note that

For non-convex loss functions, gradient descent may:

  • fail to converge (e.g., due to oscillation or divergence), or
  • converge to a local minimum, local maximum, or saddle point, rather than the global minimum.