Skip to content
Sign in

Lab

Neural Network Playground

Add neurons, layers and activations and watch a network learn.

A small neural network learning to separate two classes in the plane. Pick a dataset and an architecture, then press Train and watch the decision boundary bend to fit the data as the loss falls. This is a real network doing real backpropagation, just a tiny one, in your browser.

Decision boundary

Class 1Class 0

The network maps each point in the plane to a probability; the map above colours that probability, so the boundary is the ridge where it crosses ½. An untrained network paints a flat, meaningless field. Each Train click runs 200 full-batch gradient-descent steps, nudging every weight against the gradient of the loss, and the boundary sharpens to carve the classes apart.

XOR is the classic example that a single linear layer cannot solve: try one hidden layer of width 2 versus width 8, or switch relu to tanh, and watch how capacity and the activation change what the network can express.

Honest note: this is a 2-D toy with a handful of points trained in your browser, not a production model. The mechanism (forward pass, backprop, gradient descent) is exactly the same; the scale is not.

Challenge

Set the dataset to XOR and the hidden width to 2. Can the network separate it? Now raise the width and retrain. What is the smallest hidden layer that reliably drives the loss below 0.05?