Lensa ML
Lensa ML

The Perceptron

Step 1 of 6

A Single Neuron

The building block of neural networks

0.50x₁×0.60.80x₂×0.4Σ0.620σ()0.650ŷ
x₁0.50
x₂0.80
WEIGHTED SUM
0.620
SIGMOID(Σ)
0.650
PREDICTION
1 (yes)

A perceptron is the simplest neural network — just one neuron. It multiplies each input by a fixed weight (×0.6, ×0.4), sums them to get 0.620, then squashes through sigmoid to produce 0.650. The output ≥ 0.5, so the neuron fires — it predicts yes.

Step 1 of 6: A Single Neuron

The building block of neural networks

0.50x₁×0.60.80x₂×0.4Σ0.620σ()0.650ŷ
x₁0.50
x₂0.80
WEIGHTED SUM
0.620
SIGMOID(Σ)
0.650
PREDICTION
1 (yes)

A perceptron is the simplest neural network — just one neuron. It multiplies each input by a fixed weight (×0.6, ×0.4), sums them to get 0.620, then squashes through sigmoid to produce 0.650. The output ≥ 0.5, so the neuron fires — it predicts yes.

Step 2 of 6: Weights & Bias

How a neuron computes its output

0.85x₁×0.600.72x₂×-0.40+b=0.10Σ + b0.322σ()0.580ŷ
w₁+0.60
w₂-0.40
bias+0.10
WEIGHTED SUM
0.322
BIAS
+0.10
OUTPUT σ(Σ)
0.580

The neuron computes w₁x₁ + w₂x₂ + b = 0.322, then applies the sigmoid function. The bias shifts the activation — without it, the boundary must pass through the origin.

Step 3 of 6: The Step Function

Threshold activation

zσ(z)θ=0.500σ(z)
Input valuez = -1.20
Thresholdθ = 0.50
σ(z)
0.231
THRESHOLD
0.50
OUTPUT
0

σ(z) = 0.231 < threshold 0.50 → output is 0 (silent). Not enough signal to fire.

Step 4 of 6: Decision Boundary

Where the neuron says yes or no

-3-3-2-2-1-1112233x₁x₂
w₁+1.00
w₂+0.80
bias+0.20
EQUATION
1.0x₁+0.8x₂+0.2=0
CORRECT
27/30

The decision boundary is the line where w₁x₁ + w₂x₂ + b = 0. Points on one side output 1, the other side 0. Adjust the weights and bias to classify all points correctly!

Step 5 of 6: Learning Rule

Teaching the perceptron

-3-3-2-2-1-1112233x₁x₂
Learning rateα = 0.100
EPOCH
0
CORRECT
28/30
ERRORS
0

The perceptron learning rule: for each mistake, nudge the weights — w += α · error · x. Watch the boundary rotate and shift to minimize errors.

Step 6 of 6: Limits of the Perceptron

Why one neuron isn't enough

-3-3-2-2-1-1112233x₁x₂
DATASET
AND
ACCURACY
100%
SEPARABLE?
Yes

AND is linearly separable — a single perceptron can learn it perfectly. A straight line is enough to separate the green and red points.