Neural Networks
One neuron draws a line. Stack a few and you can wrap a boundary around anything.
One neuron can only draw a single straight line. That sounds like a dead end — until you discover what happens when you stack them. Suddenly there's almost no shape they can't wrap around.
Look at the two spirals below. There is no straight line — no single neuron — that can ever separate them; they're wound together. In the last lesson that would have been game over. So how does a machine learn a boundary this twisted?
The breakthrough is almost cheeky: feed the output of some neurons into more neurons. The first group each draw their own straight line. The next group don't see the raw data — they see those lines, and combine them into bends and corners. Add another group and the bends become curves and loops. Press Train and watch it happen.
Spiral Classifier
Press Train — this network learns live in your browser
The coloured map is what the network believes · it bends and folds as the layers learn
Dataset
Two hidden layers of 8 neurons. Press Train and watch the boundary curl around the data.
Leave it on Spiral and hit Train — the boundary writhes and slowly wraps each arm. Now the revealing experiment: drag Neurons / layer down to 2and retrain — it can't do it, there aren't enough lines to bend. Push it up to 9–10 and it untangles the spiral. That knob is the network's raw capacity.
What a network actually is
That's the whole thing: neurons arranged in layers, where each layer's outputs become the next layer's inputs. The layers in the middle — the ones that never touch the data or the answer directly — are called hidden layers. A network with several of them is a deep network — which is the entire origin of the phrase deep learning.
How does it learn all those weights?
Exactly like the line in Lesson 3. The network makes a guess, we measure the loss, and we nudge every weight a little to reduce it — gradient descent again. The only new piece is backpropagation: the trick for fairly assigning blame for the error back through every layer, so each of the hundreds of weights knows which way to move. That's the math the “epoch” counter is grinding through.
A single neuron draws a line. A layer of them draws many lines. Stacking layers lets the network bend and combine those lines into essentially any shape — the more neurons and layers, the more intricate the boundary it can learn. Depth is what turns a line-drawer into a universal pattern-finder.
There's a catch, of course. More neurons mean more capacity but also more weights to train, slower learning, and a risk of memorising the data instead of finding the real pattern. Choosing the right size is a genuine part of the craft.
This exact idea — neurons in layers, trained by gradient descent and backprop — scaled up to billions of weights and fed the whole internet, is what powers modern AI, including ChatGPT. But a network only eats numbers. So the next question is the one that unlocks language entirely: how do you turn a word into numbers?
Feel like you get it?
Continue to “Words as Numbers” →