Neural Network Playground

Watch a tiny network learn XOR in real time. Tweak neurons, learning rate, and speed, then step through forward and backward passes.

Live Network

Idle
Input Hidden Output Positive weight Negative weight

Controls

Probe an input

Epoch0
Avg loss0.0000
Accuracy0%
Prediction-
Current sample[0,0] -> 0

Output vs Sample Result

Output probability-
Decision rulep >= 0.50 -> class 1
Predicted class-
Sample target-
Relation-

How It Works

  1. 1. Forward pass

    Inputs flow left to right. Each connection multiplies by a weight, then each neuron applies a sigmoid: sigma(x) = 1 / (1 + e^(-x)).

  2. 2. Error signal

    The output is compared to the XOR target. Loss uses mean squared error so the network knows how wrong it is.

  3. 3. Backpropagation

    Gradients flow right to left. Weights nudged opposite the gradient reduce future error by a fraction set by learning rate.

  4. 4. Repetition

    Repeating this over samples and epochs teaches the network a nonlinear pattern that a single-layer perceptron cannot solve.

Tip: Use "Step 1 Sample" to inspect a single update slowly.