Gradients

17 min read

A real model has millions of weights, not one. A gradient is a list of slopes, one for each weight. It shows which way to turn all the weights at once. In this lesson you find a gradient, walk downhill with it, and see why the step size matters.

New words

Partial derivative
The slope when you change one input and hold the others fixed.
Gradient
A list of all the partial derivatives. It points uphill.
Learning rate
The size of each step you take against the gradient.
Contour map
A top-down map where each line joins points of equal height.
Gradient descent
Taking many small steps against the gradient to lower the error.

What you will learn

  1. Why do AI models need gradients?
  2. What if there are two inputs?
  3. What is a partial derivative?
  4. What is a gradient?
  5. How do you walk downhill?
  6. How big should a step be?
  7. See the path on a map
  8. Try it: roll the ball down the bowl
  9. Common mistakes
  10. Explain it to a friend
  11. Key takeaways

10 quiz questions at the end.

Start this lesson

The full lesson, with interactive demos and the quiz, opens after you sign in with Google. It is free.

All lessons · Back to the roadmap