Technology Artificial Intelligence Simulation

A real multi-layer perceptron learning a 2D classification task

Controls

Live readout

What you are seeing

Points of two classes (blue and orange) are scattered in the plane. The network starts with random weights and the background shows what it currently predicts. Each step it measures its error (loss), computes how every weight should change (backpropagation), and nudges them. Too few hidden units cannot bend around the spiral; too large a learning rate makes the loss jump; held-out white-ring points reveal overfitting.

Independent check

computing...
The science

Model. A fully connected 2 - H - H - 1 network with tanh hidden units and a sigmoid output p = sigma(z). Loss = mean binary cross-entropy -[y ln p + (1-y) ln(1-p)] plus (lambda/2)*||w||^2.

Learning. Gradients come from backpropagation (chain rule); the update is gradient descent with momentum 0.9: v = 0.9 v - eta grad L, w = w + v, full batch on 70 % of 300 points; 30 % are held out to measure generalisation.

Verification. The page re-computes the gradient of a small network by central finite differences and compares it to backprop.

Simplifications: tiny data, two inputs, no mini-batches, no learning-rate schedule. Real AI systems are vastly larger, but the training loop is the same idea.