Skip to content
All work
Machine Learning

The original learning rule, implemented from scratch and animated.

Notebook with recorded result; the demo runs the same update rule live.

NumPyMatplotlibTypeScript (demo)
Perceptron decision boundary over two classes

Overview

A single-layer perceptron with a step activation and the classic update rule, trained on linearly separable synthetic data with per-epoch error tracking and a decision-boundary plot.

Interactive demo

Same data recipe (labels from sign(x1 + x2)), step activation, and update rule. The points come from a seeded JavaScript generator rather than NumPy, so error counts per epoch differ from the notebook. Add your own points, or switch to XOR to watch it fail to converge.

Recorded results

Accuracy
0.96
500 synthetic points, 20 epochs
Source: Rosenblatt's Perceptron.ipynb, cell 3