The Perceptron, Weights, Bias and Errors
On this page 8 headings
Weights and bias make one decision
Use weights 1 and 1, bias −1.5, and output 1 when the weighted sum is at least zero.
With both inputs on, calculate the score.
Switch the second input off.
What changed? The bias sets how much positive evidence is needed before the neuron fires.
Quick check: Keep both inputs on, but change the bias to −2.5. What happens?
The score becomes −0.5, so the output is 0.
Swipe long formulas, tables or code sideways to see the rest.
Start here The MP neuron treats every input the same and needs a human to choose . In real life some reasons matter more than others. The perceptron gives each input its own weight, accepts real numbers, and — most importantly — can learn its weights from data.
- Frank Rosenblatt, an American psychologist, proposed the perceptron in 1958.
- Minsky and Papert (1969) refined and carefully analysed it. Their version is the “perceptron” used in this course.
Two main differences from the MP neuron:
- Numerical weights for the inputs, and a way to learn them.
- Inputs are no longer limited to 0/1 — they can be real numbers.
if otherwise
Now move to the left side:
if
The neat trick: add a fake input with weight . Then , and the rule becomes one clean sum starting at :
- if
- if
Lecture example — will I like this movie? Inputs (0 or ): x_{1} = isActorDamon, isGenreThriller, isDirectorNolan. From past viewing we know Nolan movies are almost always liked. So we give weight. Even if the actor is not Matt Damon and it is not a thriller, alone can push the sum over the threshold.
Weights importance. A bigger weight means that input matters more.
is called the bias because it represents a prior (prejudice) — how easily you say “yes” before looking at anything.
| Viewer | Threshold | Meaning |
|---|---|---|
| Movie buff | watches anything — genre, actor, director don’t matter | |
| Very selective viewer | watches only thrillers with Matt Damon directed by Nolan (all 3 must be 1) |
Both the weights and the bias are learned from data (here, the viewer’s history).
Why do we keep studying Boolean functions? Because they are the simplest test case. If a model can’t even do AND/OR/XOR, it can’t do real tasks. And “like/dislike a movie” is itself a yes/no (Boolean) decision.
| MP neuron | Perceptron | |
|---|---|---|
| Inputs | only 0/1 | real numbers allowed |
| Weights | none (all equal) | each input has a weight |
| Threshold | hand-chosen | learned (as bias ) |
| Learning algorithm | none | yes (next page) |
| What it can represent | linearly separable functions | still only linearly separable functions |
Very important: a perceptron also splits the input space into two halves with a line (plane). So it also can only do linearly separable functions. The difference is that its line can be learned and placed anywhere.
For the perceptron to do OR, each row of the truth table gives one condition:
| OR | Condition | Simplifies to | ||
|---|---|---|---|---|
| 0 | 0 | 0 | ||
| 0 | 1 | 1 | ||
| 1 | 0 | 1 | ||
| 1 | 1 | 1 |
One solution: Check every row:
Many other solutions also work (for example ).
and try different . Count how many of the 4 OR rows come out wrong.
| errors | Working | ||
|---|---|---|---|
| −1 | −1 | 3 | (0,0): −1 → 0 ✔; (1,0): −2 → 0 ✘; (0,1): −2 → 0 ✘; (1,1): −3 → 0 ✘ |
| 1.5 | 0 | 1 | ✘; others correct |
| 10 | −10 | 2 | (0,1): −11 → 0 ✘; (1,1): −1 → 0 ✘ |
Note on the slide: the lecture table lists 1 error for . Working it out (above) gives 3 errors: (1,0), (0,1) and (1,1) all give a negative sum, so the output is 0 when OR says 1. Only (0,0) is correct.
If we work out the error count for every possible and plot it, we get the error surface. Each point on it is one choice of weights; we want to reach a point with 0 errors.
For OR, an error happens if:
- but , or
- but .
Trying values by hand is slow. We need an algorithm that finds weights with zero error — that is the Perceptron Learning Algorithm.
In one line: A perceptron is an MP neuron with learnable weights and bias; it still draws only one line, but it can learn where to draw it.
Exam words: perceptron, Rosenblatt (1958), Minsky–Papert (1969), weight, bias , prior/prejudice, error surface, linearly separable.
