loading

Perceptron — Step-by-Step Visualization

easyAIMLNeural NetworkClassification

Step through the perceptron — the simplest neural network unit — computing a weighted sum and applying a threshold to classify inputs.

Algorithm Pattern

Linear Threshold Unit

Key Idea

The perceptron computes z = w·x + b, then outputs 1 if z > 0, else 0. It can learn any linearly separable function and is the building block of every neural network.

Step-by-Step Approach

  1. Compute weighted sum: z = w₁·x₁ + w₂·x₂ + b.
  2. Apply step function: output = 1 if z > 0 else 0.
  3. If output ≠ target: update w ← w + lr·(y−ŷ)·x and b ← b + lr·(y−ŷ).
  4. Repeat until all training examples are correctly classified.
  5. Perceptron theorem: convergence is guaranteed for linearly separable data.

Common Gotchas

  • The perceptron CANNOT learn XOR — it only handles linearly separable problems.
  • Modern neural nets use sigmoid/ReLU instead of the hard step function.
  • The perceptron learning rule is a special case of gradient descent with a step activation.

Related Problems