AI Logic

Glossary

Gradient Descent

Updated:

A valley-shaped graph with the parameter θ on the horizontal axis and the loss L(θ) on the vertical axis. Starting from the point θ₀ at the upper left, arrows move step by step in the direction opposite to the gradient (the slope of the tangent), through θ₁ and θ₂, approaching the bottom of the valley (minimum loss). At the upper right, the update rule θ ← θ − η∇L(θ) is shown, with η as the learning rate (the step size of each update).

Description

Gradient descent is an optimization algorithm that minimizes a loss function by repeatedly updating a model's parameters. Concretely, it computes the gradient (slope) of the loss function and moves the parameters in the opposite direction, with the goal of finding better model parameters. Gradient descent is grounded in differentiation: the gradient of the loss function indicates how the loss changes with respect to each parameter. Variants include batch gradient descent, which uses all of the training data; stochastic gradient descent (SGD), which uses one data point at a time; mini-batch gradient descent, which uses mini-batches; the momentum method, which makes use of past gradients; and Adam (Adaptive Moment Estimation), which adjusts the learning rate automatically. Gradient descent is an indispensable method for training models, especially in deep learning and machine learning.

Use cases

Gradient descent is widely used to train models in deep learning and machine learning. Specific examples include the following. In training neural networks, it updates the weights and biases of hidden layers and minimizes the loss function over successive epochs. In linear regression, it optimizes the model by updating parameters to solve data-fitting problems. In support vector machines (SVMs), it is used to solve the optimization problem of maximizing the margin. In reinforcement learning, it is also used to update the parameters of the action-value function based on the rewards an agent receives from its environment. As a fundamental optimization method, gradient descent is applied in a growing range of algorithms and plays a central role in the learning process.

FAQ

Q. What does gradient descent actually do?
A.

It computes the gradient (slope) of the loss function and updates the parameters in the opposite direction, gradually reducing the loss.

Q. What types of gradient descent are there?
A.

Variants include batch gradient descent, stochastic gradient descent (SGD), mini-batch, momentum, and Adam.

Q. Where is it used?
A.

It is used to optimize almost all machine learning algorithms, including neural network training, regression analysis, reinforcement learning, and SVMs.