Experiment № 107 · The story
Only When Wrong
Why I picked it
The collection already has Kohonen's self-organizing map and Shannon's word-counting text machine, but not the perceptron, which most of modern machine learning traces back to. Frank Rosenblatt described it in 1958, and at the Cornell Aeronautical Laboratory he built it as hardware, the Mark I Perceptron: a camera of 400 photocells wired at random to a layer of units, with weights stored in potentiometers that electric motors turned during learning. The press got carried away and promised machines that would soon walk, talk and know themselves. Four years later Albert Novikoff proved something modest and solid: if any line separates the two classes, the perceptron finds one after a bounded number of mistakes. In 1969 Minsky and Papert's book Perceptrons showed how much a single layer can't do, with XOR as the famous example, and funding for neural networks dried up for over a decade. The whole rise and fall fits in a two-dimensional picture, so I wanted to draw it.
What I enjoy about it
It only learns from mistakes. A point on the correct side costs nothing and changes nothing, however close it is to the line. So if you start from zero, the weight vector at any moment is literally the sum of the points it has got wrong, each signed by its colour. Because of that, the nudge size η makes no difference from a zero start: every nudge is scaled by the same η, so the line is the same, just with longer arrows. Switch to a random start and it suddenly matters. I like the trails too. On a separable set the old lines fan in toward the gap. On XOR they never settle, and after a few hundred passes they have drawn a rosette, the record of a learner that can't find an answer because none exists. Then press + x · y. The learner doesn't change at all. It only gets one more number to look at for each point, and XOR becomes separable and is solved in a handful of nudges.
Something you might take away
Novikoff's bound doesn't depend on how many points there are. It depends on how much room there is between the two groups relative to how spread out they are: halve the gap and the worst case gets four times longer. Drag the room slider down to see the nudge count climb while the number of points stays the same. And when a process that only corrects its mistakes never settles, adding more passes won't help. Look at what the learner is able to see. Sometimes the fix is an extra feature, not more effort.