Neural Network Lab

Bring a spreadsheet of data, pick what you want to predict, design a neural network, and watch it learn. Everything runs in your browser, so your data never leaves this device.

Tables: learn from a spreadsheet · Text: learn to write · Games: learn by playing itself · Worm: a real worm's brain wiring

Start with a sample dataset, or bring your own. Your data should be a table where each row is one example and each column is one piece of information about it, like a CSV exported from Excel or Google Sheets.

Try a sample

Use your own data

Drag a CSV file here

Comma, semicolon, and tab separated files all work. The first row should be column names.

Tell the network what to learn. The target is the one column you want it to predict. Inputs are the columns it's allowed to look at. Ignore anything that's just a label, like an ID number or a name.

Load some data in step 1 first.
Next, choose how big the network is. Or skip ahead: the defaults are fine.

Design the brain. Data flows left to right: from your inputs, through hidden layers of neurons that find patterns, to output neurons that give the answer. Start small; you can always make it bigger.

Hidden layers

Quick size

Dropout randomly switches off some neurons during training so the network can't rely on any single one. It helps when the network memorizes the training data but does worse on new data.

Connected is how many of the possible connections into a layer exist. Real brains are sparse: each neuron talks to only a few others. Lower values make a smaller network with fewer weights to memorize with.

Output neurons Advanced. Picked automatically from what you predict.

Your network

The defaults work well, so you can go straight to training.

Training shows the network each example, measures how wrong it was, and nudges every connection a little to be less wrong. One pass through all the training data is called an epoch. Press Start training and watch the charts: the mistakes line should fall and the accuracy line should rise.

0
Times through the data (epochs)
–
Right on unseen examples (test accuracy)
–
Mistake score, practice data (training loss)
–
Mistake score, unseen data (test loss)

Loss: how wrong it is (lower is better)

Training dataTest data it never trains on

Across: passes through the data. Up: how wrong its guesses are. Lower is better. If the test line starts rising while the training line keeps falling, it's memorizing instead of learning.

Accuracy on test data

Across: passes through the data. Up: how often it's right on examples it never trains on. Higher is better.

The network, live

Positive connectionNegative connectionBright neurons are firing for the example shownClick a neuron to explore it
Training settings Advanced. The defaults work well; open these to change how it learns.

These can be changed any time, even mid-training.

When the numbers stop changing, see how well it does on examples it has never seen.

Every neuron in a hidden layer learns to respond to some pattern in the data. Here you can see what each one has learned, which examples excite it, and what happens if you switch it off.

Train a network in step 4 to explore its neurons.
Next, see how often it gets new examples right, and where it goes wrong.

How well does it really work? Everything here is measured on the test data: examples held back from training, so it's like a surprise exam.

Train a network in step 4 to see results.
Next, try it yourself: give it new examples and see what it predicts.

Put your trained network to work on new examples, and check it against real answers it has never seen.

Train a network in step 4, or load a saved one below.

Save and share

Saved networks live in this browser and include everything needed to make predictions (but not your data). To move one to another device, export it as text.

Want to try something else? Pick another dataset and start again.

This network is wired like a real animal. The roundworm C. elegans has exactly 302 neurons, and scientists have mapped every connection between them. Sensory neurons take in the world, motor neurons move the body, and interneurons connect the two. Here that wiring diagram is frozen in place. A task's inputs go into the worm's sensory neurons, the signal flows through the real connections for a few time steps, and the answer is read from its motor neurons. Only the way inputs enter and the way the answer is read out are trained.

What this is not. A wiring diagram says who connects to whom and how many contacts they share. It doesn't say which connections excite or inhibit, or how strong they are, so each neuron here gets a random polarity (75% excitatory). Real neurons are also far richer than these simple units. This is a fun experiment with real wiring, not a simulation of a worm.

1. Give it a job

Across: training checkpoints. Up: how often each network gets new test examples right. Higher is better.

Three networks learn side by side. Real worm wiring uses the actual connections. Same synapses, shuffled has exactly the same number and strengths of connections, but wired to random neurons. No wiring reads straight from the sensory neurons.

2. Look inside the worm

Each dot is one neuron. Fill shows how active it is: teal = positive, red = negative, pale = quiet.

This example

3. Does the real wiring matter?

One training run can be lucky. This trains all three networks five times from scratch (with different random splits and polarities) and reports the average, so you can see whether real wiring genuinely does better than random wiring.

Wiring data: Cook et al. 2019, Nature (hermaphrodite whole-animal connectome), read through the OpenWorm Connectome Toolbox. Neuron classes come from the same toolbox.

Here the network isn't shown answers. It learns by playing: it tries a move, sees whether that led to a win or a loss, and slowly works out how good each move is (this is called Q-learning, and with a neural network doing the guessing, a deep Q-network). In the two-player games it plays both sides, so both improve together.

1. Pick a game

2. Design the learner

3. Train

4. Play

The numbers are the AI's ratings from +1 (it expects to win) to −1 (it expects to lose). Near 0 means it expects a draw, which is what most moves lead to against good play. It was never taught strategy, only whether it won.

Teach a network to write. It reads text and learns to guess the next character from the few characters before it, then invents new text one character at a time. This simple version has no memory beyond that short window, so it learns spelling and word shapes, not meaning. Or switch the model to Words: it guesses whole words instead, so everything it writes is made of real words.

1. Pick some text

Or paste your own

Paste any text (a few hundred characters or more), or a list of words with one per line (50 or more) to make a name-style generator.

2. Design the model

The defaults work well, so you can go straight to Train. Come back later to experiment.

It guesses the next

3. Train

Across: training progress. Up: how surprised it is by what really comes next (the loss). Lower is better. One line is the text it trains on, the other is text it never trains on.

Live sample

4. Generate

What does it expect next?