WillTeachMaths logo

WillTeachMaths

Thinking-first maths tools

Optimisation and AI

Gradient descent is not magic. It is a repeated mathematical choice.

This prototype shows how a point moves across a loss landscape by repeatedly stepping in the opposite direction to the gradient. It is a simple way into optimisation, calculus and the mathematics behind many machine learning systems.

The goal is to help learners experiment: change the learning rate, change the starting point, watch what happens, and explain why.

Interactive prototype

Watch gradient descent move across a loss landscape

The dot starts at a chosen point and repeatedly moves in the opposite direction to the gradient. Change the landscape, learning rate and start point to see what helps or harms convergence.

low losshigh loss

Iteration

0 / 24

Point

(-2.4, 2.3)

Loss

22.45

Gradient size

9.476

Joy in the process

The point is not just to finish. It is to notice, test and return.

These tools are invitations to explore. A good mistake, a surprising pattern or a question you cannot yet answer is part of the work, not a failure of it.

The challenge is deliberate: the site should support thinking, not remove the need for it.

Before changing a setting, pause and predict what you think will happen.
Change one thing at a time. What stayed the same, and what changed?
Try to create a surprising case, a broken case, or a beautiful pattern.
Ask what this connects to outside the page: maps, movement, nature, systems or decisions.
Reset, then try again with a new question in mind.

Guided exploration

Use the prototype to create predictions, not just observations.

Predict whether the next step will reduce the loss before pressing Next step.
Find a learning rate that converges slowly but reliably.
Find a learning rate that overshoots and makes the loss worse.
Compare the same learning rate on the simple bowl and narrow valley.

Future extensions

This prototype can grow into a richer classroom and exploration tool.

Add a 3D surface view alongside the contour view.
Compare gradient descent with momentum.
Add a linear regression example where the loss comes from real data points.
Add a teacher mode with prepared questions and discussion prompts.