Data & ComputingMachine LearningA-Level
AQAIBAbiturAPBaccalauréat GénéralCambridgeCAPSCBSE

Gradient Descent Calculator

Optimization update rule.

Use the free calculatorCheck the variablesOpen the advanced solver
This is the free calculator preview. Advanced walkthroughs stay in the app.
Result
Ready
New Weight

Formula first

Overview

Gradient descent is a first-order iterative optimization algorithm used to find the local minimum of a differentiable function. It functions by taking steps proportional to the negative of the gradient of the function at the current point.

Symbols

Variables

= New Weight, = Old Weight, = Learning Rate, J = Gradient

New Weight
Variable
Old Weight
Variable
Learning Rate
Variable
Gradient
Variable

Apply it well

When To Use

When to use: This algorithm is used when training machine learning models like linear regression or neural networks to minimize a loss function. It is preferred when an analytical solution is too computationally expensive or impossible to derive due to high dimensionality.

Why it matters: It is the fundamental engine behind modern artificial intelligence, allowing models to 'learn' by incrementally reducing error. Its efficiency makes it possible to optimize functions with millions of parameters across massive datasets.

Avoid these traps

Common Mistakes

  • Using a learning rate that is too large.
  • Adding gradient instead of subtracting.

One free problem

Practice Problem

A model parameter is currently at 5.0. If the learning rate is 0.1 and the gradient of the loss function is 4.0, calculate the updated parameter value.

Old Weight5
Learning Rate0.1
Gradient4

Solve for: Tn

Hint: Subtract the product of the learning rate and the gradient from the old value.

The full worked solution stays in the interactive walkthrough.

References

Sources

  1. Deep Learning by Ian Goodfellow, Yoshua Bengio, and Aaron Courville
  2. Wikipedia: Gradient descent
  3. Pattern Recognition and Machine Learning by Christopher M. Bishop
  4. The Elements of Statistical Learning: Data Mining, Inference, and Prediction by Trevor Hastie, Robert Tibshirani, and Jerome Friedman
  5. Standard curriculum — A-Level Data Science (Optimisation)