Open the editor

Computer science · University

Gradient Descent Slides

Free animated slides, ready to teach: 6 slides where every step appears on a click and the diagrams move. Play them right here, present them full screen, or copy them into your account to edit.

A real Tracé deck playing in your browser. No account needed.

What the lesson covers

Gradient descent finds the minimum of a function by taking repeated steps downhill, against the gradient. Students watch a point step down a parabola, compare small, good and too-large learning rates and run three steps by hand.

The slides, one by one

1 Gradient descent

Walk downhill to the minimum

How does a neural network learn from its mistakes?

2 Step against the slope

x_{n+1} = x_n - \eta\, f'(x_n)
f = x^2/4\textsf{, }\eta = 1\textsf{: }x\textsf{ halves each step}

3 The learning rate must be just right

f(x) = x^2\textsf{ from }x_0 = 4
\eta = 1.1\textsf{: the steps grow and diverge}

4 Three steps by hand

Minimise f(x) = (x − 3)² with gradient descent, starting at x = 0 with η = 0.1.

→ f′(x) = 2(x − 3); each step: x − 0.1 × f′(x)

x_1 = 0 - 0.1 \times (-6) = 0.6
x_2 = 0.6 - 0.1 \times (-4.8) = 1.08
x_3 = 1.08 - 0.1 \times (-3.84) = 1.464

x moves 0 → 0.6 → 1.08 → 1.464, towards the minimum at 3

5 Quick check

f(x) = x², x = 2 and η = 0.5. After one step, x is…

  • 1
  • −2
  • 0
  • 4
Show the answer

0

f′(2) = 4, so x = 2 − 0.5 × 4 = 0, the minimum.

6 What to remember

Move against the gradient

x \leftarrow x - \eta f'(x)

η too small: slow; too big: diverges

Machine learning: minimise the error

Challenge: Why might gradient descent stop at the wrong minimum on a bumpy function?

Every slide is built click by click: text, formulas and pictures come in one step at a time, so the class follows the reasoning instead of reading ahead. Graphs with sliders can be dragged live while you present.

Make your own version with AIChange the level, the numbers or the language: type the topic and get a new deck that moves in about 30 seconds. Free, no account needed.

Questions teachers ask

What does the learning rate do in gradient descent?

It sets the size of each step: x_new = x − η f′(x). Too small and progress is slow; too large and the steps overshoot the minimum and can even diverge. For f(x) = x², any η above 1 makes the steps grow.

Are these slides really free?

Yes. Watch them on this page or present them full screen with no account. Making your own copy to edit is free too.

Can I change the slides before my lesson?

Yes. Press "Make my own copy" and the deck becomes one of your projects in the Tracé editor, where you can change the text, the numbers, the colours or the order of the clicks.

Do they work on a classroom projector or an interactive whiteboard?

Yes. They run in the browser on any laptop, so anything that shows your screen works. Press the right arrow or click to go to the next step.