AstraAI

Deep learning ยท gradient descent

Watch a single neuron learn

In the curriculum:Neurons & gradient descentSee the map โ†’
๐ŸŽ“ School maths ยท Year 11Rate of change โ€” See gradient as a rate of change driving improvement.Maths by year โ†’

The Case. Deep learning sounds like magic, but at its heart is one simple loop: a tiny ‘neuron’ makes a guess, checks how wrong it was, and nudges itself to do a little better โ€” thousands of times. It's how you learned to catch a ball, and โ€” scaled up massively โ€” it's what powers ChatGPT and self-driving cars.

Your tools. Just numpy. We build one neuron from scratch and train it with gradient descent. Two sliders control how it learns.

Investigate. Drag lr (learning speed) and steps above the code โ€” the error curve redraws live so you can see the effect.

  • Turn lr too high and learning wobbles instead of settling; too low and it barely moves.
  • More steps = more practice. Every big AI model is millions of these neurons stacked.

This case is part of the Family plan

Unlock every 12โ€“15 case and the full AI, machine-learning, and deep-learning path โ€” one subscription for the whole family.

Need a hint?

Gradient descent = roll downhill on the error. Each step changes w and b a little to reduce it.