← Back to JDG Apps

How a simple neural network learns XOR

Train a 2 → 4 → 1 neural network, inspect its 17 learned parameters, and follow a prediction through every multiplication, bias, and sigmoid calculation.

Network map

Every connection and bias

17 parameters
A diagram with two inputs connected to four hidden neurons and one output.
x₁ weights x₂ weights bias
8 input weights+4 hidden biases+ 4 output weights+1 output bias= 17
Training results

Did the network learn XOR?

final loss
Forward pass

Run inputs through the trained model

XOR
Choose two inputs and run the model.
View current trained weights and biases