The LabNEURAL NETWORK PLAYGROUND TECHNOLOGY

TEACH A TINY NETWORK

Teach a tiny brain.
Watch it draw a line.

Give a real neural network a handful of labelled dots. Press train and watch backpropagation bend its boundary, then check whether it learned the rule or only memorised the dots.

EPOCH0full passes over the data
TRAINING LOSS0.000on the dots it learns from
VALIDATION LOSS0.000on held-out dots
VALIDATION ACCURACY0%held-out dots on the right side

DECISION FIELD

Where does it say orange?

  • Cyan · class 0
  • Orange · class 1
  • Validation
  • Added by you

Hover or tap the field to inspect any point.

Arrow keys move the probe. Enter or Space adds a point of the selected class at the probe. Shift with an arrow moves further.

INSIDE THE NETWORK

Neurons and weights

Each hidden square is one neuron’s view of the plane. Lines are weights: thicker means stronger, orange positive, cyan negative.

LEARNING CURVE

Loss over time

  • Training
  • Validation

THE DATA

What it learns from

64
0%
Tap the field to

Changing the dataset, dot count or lies restarts training. Added dots join the training set.

THE NETWORK

How it learns

8
0.18
0.000

Learning rate and weight penalty apply live. Neuron count restarts training. Seed 7.

WHAT’S HAPPENING

Ready when you are

The weights are random, so the field is a guess.

TRY THIS

Three small challenges

0 / 3 solved

A MODEL YOU CAN INSPECT

Soft lines, added up.

hj = tanh(wj1x + wj2y + bj)
P(orange) = σ(Σ vjhj + c)

Each hidden neuron draws one soft straight cut across the plane; you can see it in its little square. The output neuron weighs those cuts and squashes the total into a probability. More neurons means more cuts to combine, so the boundary can curve.

How the model works
  1. Guess. For every training dot, the network computes P(orange) from its current weights.
  2. Score. Binary cross-entropy measures how surprised it is by the true labels. A network that always says 50% scores 0.693, the “coin flip” line on the chart.
  3. Blame. Backpropagation works out how much each weight contributed to that loss (its gradient).
  4. Nudge. Every weight moves a step of size learning rate × gradient downhill. One step over all the dots is one epoch.
  5. Check. 48 separate validation dots, never used in the update, show whether the rule generalises.

The weight penalty (L2) adds a pull toward zero on every weight. Small weights make gentle, smooth boundaries that are harder to bend around single lying dots.

HONEST LIMITS

What this is, and is not.

A small full-batch network with one tanh hidden layer, a sigmoid output, binary cross-entropy and optional L2 regularisation. It is not a large language model, and nothing here is sent to a server.

Assumptions, controls & sources
  • Colour, not height, encodes probability. The field is sampled on a 61 × 61 grid from the same weights the readouts use.
  • “Labels that lie” flips that fraction of training labels only. Validation dots are always clean, and the validation set is for tuning, not a final unbiased test.
  • You can add up to 64 dots. They join the training set without resetting the weights.
  • Training pauses at 20,000 epochs. Speeds are animation rates, not benchmarks.
  • Keyboard: focus the field, move the probe with the arrow keys (Shift for bigger steps), and press Enter to add a dot. Space toggles training from the Train button.

TensorFlow Playground · Playground network implementation · Training and validation sets · Model notes