Lesson 0005

Shape and stacking

One family at a time is a lie by omission — the field didn't arrive at today's models by picking the "best" model. It arrived by hitting a wall, backing up, and stacking. Here's that wall, and the stack.

First, hit the wall

Each picture has two kinds of points: blue and red. Your job is simple: could one straight line put all the blue points on one side and all the red points on the other?

Real-world version: each dot is one email from the training data, placed by two measurements — across: how many suspicious links it contains; up: how many of its words scream urgency. The color isn't part of the email — it's the answer tag we already know for that training example (Lesson 0001's y): a blue dot marks an email that turned out to be normal, a red dot one that turned out to be spam. The straight line you're trying to draw is the classifier.

!
The wall

If one straight line cannot separate the two colors, then any method limited to one straight cut will fail. More practice examples will not change that shape limit.

The machine every family runs through

Now name the machinery. Every model family in this lesson enters the same pipeline from Lesson 0001:

model family --fit via D--A-->f^_D--> fitted model

Linear regression, kNN, perceptrons, and neural networks are different fills for the left-hand box.

Sharpen your pencil: family, or fitted?

Sort each item: is it a model family (a shape of candidate functions, chosen before any data), or something else?

The line you already know, wearing a new hat

Frank Rosenblatt wasn't trying to build a faster calculator. He was a psychologist, and the question underneath the formula below was stranger than anything in it: how little machinery does it take before learning appears? That question flipped the field's whole approach — not can we program intelligence with explicit rules?, but can a machine learn its own internal connections from experience?

Rosenblatt's idea began as a psychologist's question: what is the simplest physical system that could learn from experience? The perceptron was his answer — not a hand-programmed rule machine, but a network whose connections changed when it made mistakes.
old question
Can we write the rules?

Intelligence as instructions supplied by the programmer.

how little machinery before learning appears?
->
Rosenblatt's turn
Can the machine change itself?

Intelligence as connections adjusted by experience.

brain cells fire through connections + connection strengths can change + examples can correct mistakes = a machine that learns by adjusting weights

That's the whole radical move, and it's what the formula below actually encodes: not a rule someone wrote down, but a set of weights w that starts wrong and gets corrected by its own mistakes. Lesson 0001 gave you y = wTx + b for a number. Slap a perceptron's step function on the same score and you get a class instead: ŷ = h(wTx + b). Same line underneath — just a different question asked of it.

Known — linear regression
y = wTx + b
x y
output: any real number
→+ a step, h(z)
New — perceptron
ŷ = h(wTx + b)
score z if z < 0: ŷ = 0 if z ≥ 0: ŷ = 1
threshold turns the score into a class
z = -2.1 -> h(z) = 0 z = 3.4 -> h(z) = 1

The perceptron still computes the same kind of weighted score, z = wTx + b. The new piece is the threshold function h: negative scores become class 0, nonnegative scores become class 1. That one addition is the whole jump from "predict a number" to "predict a class."

Where a straight line hits its wall

No perceptron — trained any way you like, for as long as you like — can solve the XOR case above. That's not a training failure. It's a shape limit: a single straight cut simply cannot wall off two interleaved corners from the other two.

🧱
The recurring idea

A model can only express the boundaries its own geometry allows. No amount of data, and no cleverer training, rescues the wrong family — you have to change the shape.

Stack them: the multi-layer perceptron

One straight cut fails. Stacking changes the shape: perceptrons feed their 0/1 answers into more perceptrons, so later layers can combine simple cuts into corners and curves.

1 One line fails XOR and rings do not split cleanly.
2 Two cuts help Hidden perceptrons carve pieces.
3 Combine the pieces The next layer votes on those cuts.
4 Boundaries bend The family can express richer shapes.
Perceptron
Can draw: one straight cut
→feed its output into more perceptrons
Multi-layer perceptron
Can draw: cuts combined into corners
→keep stacking layers
Neural network
Can draw: much richer boundaries

Top row: the anatomy. Bottom row: the boundary that anatomy can draw. Notice the ring dataset from the exercise above — unsolvable in panel one, solved in panel three.

🔗
The key insight

A perceptron's output can be another perceptron's input. That's the entire trick — nothing inside any single unit changed. In notation, an MLP is h(ℓ) = σ(W(ℓ)h(ℓ-1) + b(ℓ)): each layer transforms the previous layer's outputs.

What do we call perceptrons stacked in layers, each fully connected to the next?

Neural networks join the family lineup

A handful of words get thrown around as if they're synonyms. They're not — they're nested, and the pipeline from the top of this lesson already gives you the vocabulary to tell them apart:

TermWhat it actually is
MLThe field: improve performance on a task from experience (Lesson 0001's T/E/P).
ML pipelineThe two-phase process — D --A--> f^_D, then x --f^_D--> s --δ--> a — that applies no matter which family fills in f.
ModelGeneric word for one candidate function f. Ambiguous on its own — always ask "family, or fitted?"
Neural networkOne model family among several (alongside linear/softmax regression, kNN) — stacked layers instead of one line.

Two more words belong on this list — transformer and GPT — but they need attention (literally) before they mean anything. Lesson 0007 picks up exactly there.

Check your recall

Answer from memory first — that's the part that makes it stick.

What property of a dataset determines whether a single perceptron can solve it?
What do we call the piece that turns a weighted sum into a signal — a step, sigmoid, tanh, or ReLU?
Want the ring-dataset exercise with an actual draggable boundary to try (not just judge by eye), or the full story of why XOR ended a decade of funding? The second one's coming in Lesson 0010 — just ask for the first.