See how a neural network learns.
Build a tiny neural net. Train it on real patterns. Inspect its weights, activations and gradients—one experiment at a time.
Decision boundary LIVE
See the model's prediction across the input space.
Configure & train
Change a setting and observe the effect.
Network architecture
Explore how information moves from input to prediction.
Neuron inspector
Select a node to inspect its parameters.
Click any node in the network map to inspect its activation, bias and incoming weights.
Learning curve
Binary cross-entropy across training epochs.
What is a decision boundary?
A decision boundary is the line or surface a classifier uses to separate classes. A neural network creates it by composing simple mathematical transformations. Watch this map evolve as the loss decreases.
Experiment lab.
Compare learning choices on the same dataset. Keep the architecture and data fixed, then change one variable at a time.
XOR classification
The active dataset will be shared across each comparison run.
Each configuration starts from its own initial weights and trains on the same dataset. Results are educational estimates, not a scientific benchmark suite.
Configuration matrix
Four complementary baselines, one consistent dataset.
Adam + Tanh
Adaptive step sizes with smooth hidden activations.
SGD + Tanh
A simple gradient step with no adaptive moments.
Adam + ReLU
Adaptive optimisation with a piecewise-linear activation.
Momentum + Tanh
Gradient descent with a moving average of updates.
Outcome comparison
Lower loss and higher accuracy are better, but also inspect stability and convergence.
| Configuration | Final loss | Accuracy | Parameters | Time |
|---|---|---|---|---|
| No experiment results yet. | ||||
Learn the building blocks.
A hands-on field guide to the pieces that make a small neural network work. Change the model and watch these ideas become visible.
Learn a function from examples.
A neural network is a chain of parameterised transformations. Training adjusts those parameters so predictions become more useful on examples with known labels.
Neurons & layers
Each neuron combines inputs with weights, adds a bias, and applies an activation function. Layers compose these small operations into a flexible model.
Activation functions
Non-linear activations allow networks to represent curved and complex boundaries. Without non-linearity, stacked dense layers collapse into one linear transformation.
Loss & gradients
Loss measures the cost of predictions. Backpropagation applies the chain rule to estimate how each parameter contributes to that cost.
Optimisation
An optimiser turns gradients into parameter updates. SGD, Momentum and Adam use different rules, each with trade-offs in speed and stability.
Generalisation
A model can memorise examples without learning a reliable pattern. Noise, dataset shape and model capacity all influence how a boundary behaves.
Experimental thinking
Change one variable, record the outcome, and repeat from comparable initial conditions. A single run is an illustration, not proof of a general claim.
Glossary
Small words, big ideas.
One complete pass over all training examples.
A subset of examples used to calculate one update.
The step scale used when updating model parameters.
A trainable offset that shifts a neuron's response.
A learnable value, such as a weight or bias.
The region where the predicted class changes.
Model guide.
A transparent map of the current implementation, its math, its limits, and ways to reproduce an experiment.
What this lab trains
A fully connected multilayer perceptron for two-dimensional, binary classification. The input layer has two features and the output is a single sigmoid probability.
Hidden widths are configurable (1–4 layers, 2–32 neurons per layer). The demo uses synthetic data and runs training locally in the browser.
Binary cross-entropy
The output probability is compared with a binary target. Numerical clamping keeps the logarithm finite near 0 and 1.
With sigmoid output and binary cross-entropy, the output-logit derivative simplifies to p − y.
Three update rules
SGD applies the current gradient. Momentum smooths updates with a running velocity. Adam adapts each parameter's update using first and second gradient moments.
All optimisers use the same binary objective and training examples for a fairer, though still illustrative, comparison.
Export and repeat
Export the current model weights as JSON, or the exact synthetic points as CSV. The browser model file includes its architecture, activation, optimizer, learning rate and parameter arrays.
NumPy + Matplotlib
The repository also contains a small NumPy implementation and a command-line experiment script. Use it for saved metrics, reproducible seeds and decision-boundary plots.
python scripts/train_numpy.py --dataset xor
Browser experiments and Python runs are separate execution paths; their results are not expected to match exactly because their random-number streams differ.
Learning demo, not a benchmark
Small synthetic datasets are intentionally simple. Training accuracy is measured on the generated training examples and should not be interpreted as generalisation performance.
For research claims, use separate validation/test data, multiple seeds, explicit baselines, and report uncertainty.