Afterglowscreensavers

Perceptron Learning Screensaver

The Perceptron Learning screensaver trains a real single-layer perceptron live, rotating its decision boundary with every misclassified point until it separates two random classes. It is free, runs in your browser, and ESC exits.

Live preview

Perceptron Learning screensaver — A real perceptron's decision line, rotating into place.

Press ESC to leave fullscreen. Settings are saved in your browser only.

How the Perceptron Learning screensaver works

The saver scatters two real randomly generated, linearly separable classes of points on the canvas.

A real perceptron's decision line starts in a random position, then the algorithm checks one random point per step against its current classification.

Whenever a point is genuinely misclassified, the real perceptron update rule nudges the weight vector, visibly rotating and shifting the decision line.

Once every point is correctly classified, the boundary holds briefly, then a fresh pair of random classes and a new perceptron begin training.

Rosenblatt's perceptron and the first learning machine

The perceptron was introduced by Frank Rosenblatt, who worked at the Cornell Aeronautical Laboratory and described the model in a 1958 paper. It is among the earliest models of a neuron that can learn from examples. It takes a list of numeric inputs, multiplies each by a weight, adds them up and outputs one of two classes depending on whether the total is above a threshold. Geometrically, the weights define a line, or a plane in higher dimensions, that splits the space in two.

Learning is simple: when the perceptron misclassifies an example, it nudges the weights toward getting that example right. If the two classes can be separated by a straight line, the procedure converges after finitely many mistakes; with maximum input norm R and margin gamma, the number of mistakes is at most (R/gamma) squared, so a wider margin means fewer corrections. If the data are not separable, it never converges.

In 1969 Marvin Minsky and Seymour Papert showed in their book Perceptrons that a single-layer perceptron cannot learn XOR, where no straight line separates the classes. The book is credited with a sharp decline in neural network research interest, which lasted until the 1980s resurgence. Networks with two or more layers are more powerful, and backpropagation is the standard way to train them.

A worked example

A point sitting just on the wrong side of the line triggers a real weight update that rotates the boundary just enough to bring that point onto the correct side, without necessarily fixing every other point at once.

Settings & tips

Frequently asked questions

Is this a real machine-learning algorithm?
Yes — a real single-layer perceptron with the genuine classic learning rule, not a scripted animation.
What happens if the data isn't separable?
The saver only generates real linearly separable classes, so a perfect boundary is always genuinely reachable.
Is a key needed?
No — it is a pure local computation.
Is it free?
Yes — free, no download, in your browser.
Why can't a perceptron learn XOR?
XOR's two classes are arranged diagonally, so no single straight line separates them. A network with a hidden layer can solve it.
What is the learning rate?
It scales the size of each weight adjustment. A larger rate makes bigger jumps, a smaller one makes slower but gentler corrections.
How is the perceptron related to modern neural networks?
Each unit in a modern network is a refinement of it, with a smoother activation than a hard threshold and many layers trained together by gradient methods.

← All Science & Research screensavers