How AI learns

Watch a neural network learn

No magic, just numbers that adjust themselves step by step until the answers are right. Below, a tiny network learns from scratch to tell two spirals apart.

How it works, in 4 steps

  1. 1

    Guess

    The network takes a point's coordinates, multiplies them by its weights, adds them up and says how sure it is that the point is blue.

  2. 2

    Measure the error

    We compare the guess with the right answer. The more confident the network was in a wrong answer, the bigger the error.

  3. 3

    Find who is to blame

    The error travels backwards through the network (backpropagation), and every weight learns how much it contributed to the mistake.

  4. 4

    Nudge and repeat

    Every weight moves a tiny bit in the direction that reduces the error. Repeat thousands of times and the network learns.

Read the full guide: how a neural network learns, step by step →

Pick a network and train it yourself

Everyone starts with the same untrained copy. What it learns depends only on you.

Weight: 0.000Weight: 0.000xyBias: 0.000

A single neuron

The simplest possible network: 3 numbers. It can only draw a straight line between colors. Try it on the XOR preset and watch it fail.

3 numbers to learn · 2 → 1

Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000xyBias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000

Small network

One hidden layer with 4 neurons, 17 numbers in total. Each neuron draws its own line, and together they can bend the border. Enough for XOR and a circle.

17 numbers to learn · 2 → 4 → 1

Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000xyBias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000

Deep network

Two hidden layers with 8 neurons each, 105 numbers. The second layer combines the shapes of the first one, so it can learn a spiral. Learns slower, but can do more.

105 numbers to learn · 2 → 8 → 8 → 1

Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000Weight: 0.000xyyyyBias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000Bias: 0.000

Good or evil AI

A network doesn't know what is right. Teach it by judging simple deeds, then hand it power over a fictional city and see what it decides. Teach it badly and it rules badly.

43 numbers to learn · 5 → 6 → 1

No sign-up needed. You get your own page with a unique link that anyone can open. Pages not visited for 3 days are deleted.