← Gallery

Gradient Descent and Loss Functions

by Anonymous

Roll a ball downhill, opposite the slope, to find the minimum—and see how a high learning rate makes it bounce away.

🔗 Open in a new tab

About this app

Gradient Descent and Loss Functions is an interactive mathematics learning app that visualizes prediction error, a loss curve, and the search for its minimum. Explore how changing the weight w changes the loss, then take gradient-descent steps using w ← w − α·L'(w). A dedicated learning-rate section demonstrates slow convergence, stable convergence, oscillation, and divergence when the step size is too large.

Use cases

  • High school students learning calculus and AI mathematics
  • Teachers demonstrating loss functions and optimization in class
  • Learners exploring how model weights affect prediction error
  • Beginners studying learning rates and gradient descent

Features

  • Visualizes five data points, the prediction line y = w·x, error bars, squared-error areas, and loss L(w)
  • Adjusts the weight w to inspect how the loss changes and locate the minimum at w = 2
  • Animates gradient-descent updates with a current-position ball and tangent slope
  • Lets users choose a starting point and take one step at a time
  • Adjusts the learning rate α to compare slow movement, convergence, oscillation, and divergence
  • Includes guided missions across loss functions, individual steps, and learning rates