|
|
|||||||||||||||||||||||||||||||||||||||||||||||||
|
The perceptron is the simplest neural network unit: a weighted sum of inputs followed by an activation function. It is the building block from which every multi-layer network is constructed, and learning how a single perceptron classifies is the cleanest way to build intuition for what neural networks do at all scales. This tutorial shows the perceptron computing a 2-input logic-gate output in real time. You can edit the two weights and the bias directly to see how the decision boundary moves, switch between activation functions to see how their curves shape the output, or hit Train to let the perceptron learn an AND/OR/NAND/NOR truth table on its own. Sections Mathematical FoundationA perceptron computes a weighted sum of its inputs plus a bias, then passes the result through an activation function: y = f(Σi wi · xi + b) = f(w1x1 + w2x2 + b)
The decision boundary — the locus where the perceptron flips between output classes — is the line in input space where the weighted sum equals zero: w1x1 + w2x2 + b = 0
So a 2-input perceptron can only draw straight-line decision boundaries. That's the central constraint that makes it solve some logic gates but not XOR. Activation FunctionsThe activation
Step is non-differentiable, so it can only be trained by the classical perceptron rule (not gradient descent). All others are trained by gradient descent. Perceptron Learning RuleFor a step-activation perceptron, weights and bias are updated by: wi ← wi + η · (target − output) · xi
b ← b + η · (target − output)
If the prediction is correct, the error is 0 and nothing changes. If it's wrong, weights move in proportion to the error and the input that produced it. Rosenblatt's convergence theorem guarantees this rule converges in finite steps for any linearly separable problem. Which Gates Are LearnableA 2-input perceptron can solve any 2-input Boolean function whose 1s and 0s can be separated by a single straight line:
Why XOR isn't here: the 1s of XOR sit at opposite corners of the unit square; any straight line separating them also splits one class in two. This is the foundational limitation that motivated multi-layer networks — see MLP I.
SimulationThe interactive simulator is below. Edit weights and bias directly with the sliders, toggle inputs to see the output, or pick a gate preset and hit Train to watch the perceptron find the right weights on its own.
ParametersFollowings are short descriptions on each parameters
ButtonsFollowings are short descriptions on each Button
|
|||||||||||||||||||||||||||||||||||||||||||||||||