Inkhmer LogoInKhmerBuilding the digital future
  • About
  • Projects
  • Blog
  • Tools
  • Learn
  • Contact
KMខ្មែរENEnglish

InKhmer.com — a personal Khmer Digital Hub curated by our team. Tools, Cambodia resources, Khmer culture, and digital projects. Practical, approachable, and built for everyone.

Social

FacebookTelegram

Quick Links

  • About
  • Projects
  • Blog
  • Tools
  • Learn
  • Contact

Explore

  • What We Build
  • How We Build
  • Roadmap
  • Experiments
  • Sitemap

Subscribe to our newsletter

Get the latest updates about Cambodia, new tools, and exclusive content delivered to your inbox.

  • Terms of Service
  • Privacy Policy
  • Cookie Policy

© 2026 InKhmer. All rights reserved.

LearnMachine Learning FoundationsGradient descent: how a model actually learns

Gradient descent: how a model actually learns

Last lesson we said "the computer adjusts numbers until the error is small". How does it adjust them? The answer is gradient descent — walking downhill.

Imagine standing on a mountain in the dark and wanting to reach the valley. You cannot see, but you can feel which way the ground slopes. Strategy: take one small step in the steepest downhill direction, then repeat. In ML the "mountain" is the error surface (the loss), a "step" is a change to the model's numbers, and the slope is called the gradient.

The step size is called the learning rate. Too large and you jump over the valley and bounce back — the error oscillates. Too small and you take thousands of steps before arriving — training is slow. The skill you learn is picking a step size that fits.

When the error stops falling we say the model converged. The stopping point may be the deepest valley (global minimum) or just a small pit (local minimum). In real problems you help by trying different starting points and shrinking the steps near the end.

Play with the widget below: change the learning rate and watch the error curve. Note which rate makes the error fall fast and stay stable.

What to remember:

  • Gradient descent = walking downhill on the error surface
  • Learning rate too big → oscillation; too small → slowness
  • Training is a loop: predict → measure error → adjust → predict again

Sign in to start tracking from this lesson