Tested tool guide
Tested browser tools
Checked August 16, 2026
What Perceptron Learning Visualizer does, with a checked example
This tool trains a single-layer perceptron against 2D points you place and label by class. Each point is fed through a step activation one at a time; when the perceptron misclassifies it, the tool nudges the weight vector and bias in the direction that would have fixed that one point, then redraws the decision boundary immediately. People are usually surprised that convergence is not guaranteed: if the two classes can't be separated by a straight line, the boundary keeps sliding and never settles - that's expected behavior, not a bug in the tool.
Worked example
A concrete input and expected output from the current implementation.
Input
Two labeled points: (1, 1) -> +1 and (-1, -1) -> -1. Start weights w1=0, w2=0, bias=0, learning rate=1, step activation returns +1 when w1*x1 + w2*x2 + b >= 0, else -1.
->
Expected output
After (1,1): output is +1 (sum = 0, meets >=0), matches target, no update. After (-1,-1): output is still +1 (sum = 0) but target is -1, so weights update to w1=2, w2=2, bias=-2.
The rule is w += lr*(target-output)*x and b += lr*(target-output). On the second point, target-output = -1-1 = -2, so adding -2*(-1,-1) = (2,2) to the weights and -2 to the bias is exactly what pulls the boundary toward classifying that point correctly.