What is Gradient descent?
An optimization method that computes the gradient of the loss function (the partial derivative with respect to each parameter) and repeatedly moves the parameters a little in the direction opposite to the gradient, searching for parameters that make the loss small. The update is written w ← w − η∇L, where η is called the learning rate. Stochastic gradient descent (SGD), which uses gradients computed on part of the data (a mini-batch), and its refinements such as momentum and Adam are widely used to train neural networks.
Japanese name: 勾配降下法
Gradient descent appears in 1 practice question across 1 topic, including Machine Learning Basics.
Field: Machine Learning Basics
The update rule and the learning rate
Viewing the loss L as a function of a weight w, the gradient ∂L/∂w gives the direction and size of the increase in L when w is increased slightly. So w is moved against the gradient: w ← w − η × ∂L/∂w. For example, with L = (w − 3)² and a start at w = 0, the gradient is 2 × (0 − 3) = −6, so with η = 0.1 the weight moves to 0.6. In this example, η = 0.1 shrinks the remaining distance to the minimum at w = 3 by a factor of 0.8 at every update, whereas η = 1.1 overshoots the minimum each time and the distance grows by a factor of 1.2, so the iteration diverges.
FAQ
How does gradient descent differ from backpropagation?
Backpropagation is a method for efficiently computing the gradient of the loss with respect to every weight of a neural network. Gradient descent is a method that uses those gradients to update the weights. Training repeats the cycle of computing the loss with a forward pass, computing the gradients with backpropagation and updating the weights with gradient descent.
Does gradient descent find the best solution?
If the loss function is convex (has a single valley), a suitably chosen learning rate brings it close to the minimum. The loss of a neural network is not convex, so what is found is often a local solution, but experience shows that networks with many parameters still often reach performance that is good enough in practice.