Log in Sign up
Back to Discover
🔢

Gradient descent

math Maturity 11-13

Imagine you are in the mountains.

Okanogan-Wenatchee National Forest, morning fog shrouds trees (37171636495).jpg
Okanogan-Wenatchee National Forest, morning fog shrouds trees (37171636495).jpg
Thick fog hides the path. You want to go down. You feel the ground with your feet. You walk where it goes down. You keep going down. Soon you find the bottom. Can you find the way down?

52 words

Imagine you are in the mountains.

Okanogan-Wenatchee National Forest, morning fog shrouds trees (37171636495).jpg
Okanogan-Wenatchee National Forest, morning fog shrouds trees (37171636495).jpg
Thick fog hides the path. You want to find the bottom. You feel the ground with your feet. You walk where it goes down. This is like a math tool.
Gradient descent.svg
Gradient descent.svg
It helps find the lowest point. It takes many small steps. Each step goes down the steepest part. It can also find the very top. This is called ascent. This tool helps computers learn.
Gradient Descent Example Nonlinear Equations.gif
Gradient Descent Example Nonlinear Equations.gif
It is very useful for smart machines.

92 words

Imagine you are lost in the mountains.

Okanogan-Wenatchee National Forest, morning fog shrouds trees (37171636495).jpg
Okanogan-Wenatchee National Forest, morning fog shrouds trees (37171636495).jpg
A thick fog hides the path. You cannot see the bottom. You must feel the ground with your feet. You walk where the slope goes down. This is how a math tool called gradient descent works.
Gradient descent.svg
Gradient descent.svg

Gradient descent is a way to find the lowest point of a function. A function is like a mathematical shape. It can look like a bowl. The tool takes many small steps. Each step goes in the direction of the steepest descent. This means it moves where the ground drops fastest.

To work well, the tool needs a step size. This is also called a learning rate. If the steps are too small, it takes a long time. If the steps are too big, you might skip over the bottom.

Gradient Descent Example Nonlinear Equations.gif
Gradient Descent Example Nonlinear Equations.gif

This idea was first suggested by Augustin-Louis Cauchy in 1847. Today, it is very important for artificial intelligence. It helps smart machines learn by reducing errors. It can also find the highest point. This is called gradient ascent.

186 words

Imagine you are hiking in a mountain range during a very heavy fog. You cannot see the path ahead or the valley below. To find your way down, you must feel the slope with your feet. You look for the direction where the ground drops most sharply. By taking many small steps in that downhill direction, you will eventually reach the bottom. This is exactly how a math tool called gradient descent works.

Gradient descent.svg
Gradient descent.svg
It is a way to find the lowest point of a mathematical shape, which is often called a function.

In math, a function can look like a giant bowl. The goal is to reach the very bottom of that bowl. To do this, the tool calculates the gradient at its current spot. The gradient tells you which way is up. Because we want to go down, we move in the opposite direction. This direction is called the steepest descent. We also have to choose a step size, which is often called a learning rate. If the steps are too small, the journey takes a long time. If the steps are too large, you might jump right over the bottom and miss it.

Gradient Descent Example Nonlinear Equations.gif
Gradient Descent Example Nonlinear Equations.gif

People have been studying these mathematical paths for a long time. A mathematician named Augustin-Louis Cauchy first suggested this method in 1847. Later, in 1907, Jacques Hadamard proposed a similar way to work. In 1944, Haskell Curry studied how these steps work for more difficult, non-linear problems. Over the many decades since then, scientists have made the method even better. Today, a simple version called stochastic gradient descent is used all the time. It is the main tool used to train deep networks in artificial intelligence.

There are many ways to make these steps more efficient. Some people use a method called line search to find the best step size. This can follow special rules called the Wolfe conditions. Other methods, like backtracking line search, also help find good settings. When a function is convex, it means the shape is very smooth like a bowl. In a convex shape, every low point is also the lowest possible point. This helps the tool find the perfect global solution without getting lost.

Steepest descent.png
Steepest descent.png

Gradient descent is useful for many different types of math puzzles. It can help solve systems of linear equations by turning them into a minimization problem. Sometimes, the path the tool takes looks like a zig-zag. This happens when the shape is very long and narrow instead of round. Even though it might zig-zag, the tool still moves toward the answer. This method works in many dimensions at once. It helps computers learn by constantly trying to reduce errors and find the best possible settings.

467 words

Gradient descent is a method used for unconstrained mathematical optimization. It is a first-order iterative algorithm. This means it uses a sequence of steps to minimize a differentiable multivariate function. In simple terms, it finds the lowest point of a mathematical surface. This process is vital in machine learning and artificial intelligence. It helps computers minimize a cost function or a loss function. This reduction of error allows machines to learn from data.

Gradient descent.svg
Gradient descent.svg

The mechanism relies on the concept of a gradient. A gradient is a vector that points in the direction of the steepest ascent. To find the minimum, the algorithm takes steps in the opposite direction. This is known as the direction of steepest descent. If you move in the direction of the gradient, you perform gradient ascent to find a maximum. The algorithm starts with an initial guess for a local minimum. It then calculates the gradient at that specific point. The next point is found by subtracting a portion of the gradient from the current position. This process repeats until the algorithm reaches a minimum point.

Choosing the right step size is a critical part of the process. This step size is often called the learning rate. If the learning rate is too small, the algorithm will converge very slowly. If the learning rate is too large, the algorithm might overshoot the minimum. This can lead to divergence, where the algorithm fails to find the bottom. Mathematicians use different methods to find a good step size. One method is called line search. This can follow specific rules known as the Wolfe conditions. Another approach is backtracking line search, which provides good experimental results.

Gradient Descent Example Nonlinear Equations.gif
Gradient Descent Example Nonlinear Equations.gif

There are different types of functions that affect how the algorithm behaves. A function is called convex if it has a bowl-like shape. In a convex function, any local minimum is also the global minimum. This means the algorithm is guaranteed to find the absolute lowest point. However, non-linear functions can be much more complex. In these cases, the algorithm might get stuck in a local minimum. A local minimum is a low point that is not the lowest point of the entire function. It might also get stuck at a saddle point.

Okanogan-Wenatchee National Forest, morning fog shrouds trees (37171636495).jpg
Okanogan-Wenatchee National Forest, morning fog shrouds trees (37171636495).jpg

The history of gradient descent spans many important mathematicians. Augustin-Louis Cauchy is generally credited with suggesting the method in 1847. Later, in 1907, Jacques Hadamard independently proposed a similar method. The convergence properties for non-linear problems were studied by Haskell Curry in 1944. Since then, the method has become much more widely studied. Today, a simple extension called stochastic gradient descent is very common. It is the basic algorithm used to train most deep networks in modern artificial intelligence.

Gradient descent can also be used to solve systems of linear equations. This is done by reformulating the system as a quadratic minimization problem. If the system matrix is real, symmetric, and positive-definite, the method works very well. However, the path taken can sometimes be inefficient. If the condition number of the matrix is large, the algorithm produces a zig-zag path. This happens because the residual vectors are orthogonal across iterations. The algorithm tends to overshoot and then correct itself in a different direction.

Steepest descent.png
Steepest descent.png

This mathematical tool is deeply connected to many fields of science. It works in spaces of any number of dimensions. It can even work in infinite-dimensional function spaces. In those cases, mathematicians use the Fréchet derivative to find the direction. Whether solving nonlinear equations or training neural networks, the core idea remains the same. It is a constant search for the most efficient path toward a minimum. This makes it one of the most important tools in modern mathematics and computer science.

636 words
🖼️ Images & Media (5)
Gradient Descent in 2D.webm
File:Gradient descent.svg
Gradient descent.svg
File:Okanogan-Wenatchee National Forest, morning fog shrouds trees (37171636495).jpg
Okanogan-Wenatchee National Forest,...
File:Steepest descent.png
Steepest descent.png
File:Gradient Descent Example Nonlinear Equations.gif
Gradient Descent Example Nonlinear Equations.gif
Up Next
🔢
Gradient
Math
More to explore

🔬 Go deeper

More advanced topics to explore

🪜 Step back

Simpler topics to build understanding

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.