The Perceptron
One neuron, the original
The perceptron (1958) is the simplest artificial neuron: it takes a few inputs, multiplies each by a weight, adds them up with a bias, and fires a 1 or 0 depending on whether the total clears a threshold.
z = w₁x₁ + w₂x₂ + … + b, then output 1 if z ≥ 0 else 0.
Look familiar? It's almost exactly logistic regression — the same weighted sum — but with a hard step activation instead of the smooth sigmoid. That one swap is the bridge from classic ML to neural networks.
Watch a neuron compute and learn
The animation shows the weighted-sum machine, then the perceptron nudging its weights until the line separates the two classes.
The pieces
How much each input matters. Learned from data — the knobs the neuron tunes.
Shifts the threshold — lets the neuron fire more or less easily, independent of inputs.
Turns the sum into an output. The perceptron uses a hard step; modern neurons use smoother functions.
For each example: if the prediction is wrong, nudge the weights toward the correct answer — w ← w + η(y − ŷ)x. Repeat until the line separates the classes.
Power and limits
- Learn any linearly separable boundary
- Act as AND, OR, NOT gates
- Train with a simple, guaranteed-to-converge rule (if separable)
- Solve XOR — no single line separates it
- Capture non-linear patterns
- Output probabilities (hard step, not smooth)
Stack many neurons into layers, give them smooth activation functions, and you get a neural network that can bend around any pattern — including XOR.