Gradient Descent

Master gradient descent algorithm for minimizing loss with the right learning rate and initialization in this lesson.

What is gradient descent?

Gradient descent is an optimization algorithm used for finding the minimum of a function. It’s an iterative algorithm that starts from an initial guess of the minimum and then takes steps in the direction of the negative gradientGradient is the vector of partial derivatives of a function concerning its variables, and it represents the direction and magnitude of the steepest ascent of the function. of the function at that point. The negative gradient of a function points in the direction of the steepest descent, which is the direction in which the function decreases most rapidly. The algorithm gradually converges to the minimum of the function by taking steps toward the negative gradient.

Gradient descent algorithm

Here are the steps involved in the gradient descent algorithm:

  1. Choose an initial guess for the minimum of the function.

  2. Calculate the gradient of the function at the current guess. This involves taking the partial derivative of the function with respect to each of the input variables.

  3. Multiply the gradient by a small positive number called the learning rate, which determines the step size of the algorithm.

  4. Subtract the result from the current guess to obtain a new guess for the minimum.

  5. Repeat steps 2–4 until the algorithm converges to a minimum.

Get hands-on with 1200+ tech skills courses.