Machine Learning · 101

How a neural network learns

Watch a tiny network figure out the XOR puzzle by adjusting its connections. Each line is a weight — the network learns by nudging them to reduce its mistakes.

The network
Idle
Positive weight
Negative weight
Stronger = thicker line
Loss over time
0.50
XOR — output 1 when inputs differ

What's happening

STEP 01
Forward pass
Inputs flow through the network. Each connection multiplies by a weight, then neurons squash the result.
STEP 02
Measure error
The network's guess is compared to the right answer. The difference is the loss.
STEP 03
Backpropagate
Each weight is blamed for its share of the error. The math flows backward through the network.
STEP 04
Update weights
Weights are nudged in the direction that reduces error, scaled by the learning rate.