
Trilogy, part I: Learns
micrograd 3D
Watch a tiny neural network learn, one gradient at a time.
built with Claude for Joe Gao
What
An interactive page that shows a neural network learning in real time. The engine is Andrej Karpathy’s micrograd, rewritten from scratch in TypeScript: a scalar Value that records every operation, and a backward() that walks the graph in reverse to hand each weight its gradient. It is made for CS students meeting backprop for the first time.
How
A 2 → 8 → 8 → 1 network learns the two-moons dataset with hinge loss and plain gradient descent. Every neuron is a sphere and every one of its 88 weights is a line. A line glows warmer the larger the gradient backprop just sent through it (the largest few light up most), so you see where learning flows rather than what the weights are.
Beside it, the decision boundary bends through the data and a loss curve falls on a log scale. Play, pause, step, or run it at up to 60 steps a second. Pause at any moment to step through one point’s backward pass, neuron by neuron, with the chain rule written out. Tests check the gradients against values worked out by hand and against finite differences.
Next
A toy problem on purpose: scalar autograd suits 88 weights and 100 points, not real datasets, and the accuracy shown is on the same 100 points it trains on, with no held-out set.






















