Perceptron Learning Animation illustration

Perceptron Learning Animation

The perceptron is the original neural network: a single neuron that predicts the sign of w·x + b and learns only from its mistakes. Each step the animation finds a misclassified point, rings it, and applies the update w ← w + η·y·x — you watch the weight-vector arrow swing from the origin and the perpendicular decision boundary rotate toward the offending point. Load linearly separable blobs to see it converge, a tight-margin dataset to see it grind through many more updates, and XOR to see it fail forever — the demonstration that ended the first neural-network era. A learning-rate slider and a shuffle button change the trajectory, and the status tracks epochs, mistakes per pass and total updates, with a banner once a full clean pass proves convergence.

Runs 100% in your browser — models are trained and computed locally on your device.

Notes

  • Update rule: only when a point is misclassified, i.e. y·(w·x + b) ≤ 0, set w ← w + η·y·x and b ← b + η·y; correctly classified points change nothing.
  • The perceptron convergence theorem bounds the number of updates by (R/γ)² on separable data with margin γ and radius R — the tighter the margin, the longer it can take.
  • On non-separable data such as XOR the rule cycles forever, the limitation Minsky and Papert made famous in 1969; fixing it takes hidden layers (see the neural network playground).
  • Starting from zero weights, the learning rate only rescales w and b uniformly, so it never changes which points get misclassified — it matters only for a nonzero initial w.
  • Runs 100% in your browser — models are trained and computed locally on your device.