Before we build a learning algorithm, let us do the learning by hand once. It shows exactly what the algorithm will have to do.
OR as four inequalities
For two inputs, the perceptron computes . It should be below 0 when OR is 0, and at least 0 when OR is 1. Substituting each input:
| OR | requirement | ||
|---|---|---|---|
| 0 | 0 | 0 | |
| 0 | 1 | 1 | |
| 1 | 0 | 1 | |
| 1 | 1 | 1 |
We need numbers that satisfy all four at once.
One solution
Try , , :
- ✓
- ✓
- ✓
- ✓
Geometrically, the boundary is . It cuts off the origin on the negative side and leaves the other three points on the positive side, as in the previous lesson.
Many solutions, and wrong ones
This is not the only answer. Changing slides the line up or down (it controls where the line crosses the axes), and changing and tilts it. Plenty of values work.
Plenty do not. Try , . The input gives , so the neuron outputs 0 when OR says 1. That line puts a point on the wrong side, and the perceptron makes an error.
So the job is: find a line that puts every 0-input on one side and every 1-input on the other.
The same idea for the MP neuron
The MP neuron had the same problem with only one unknown, . Writing the four inequalities for it gives a single number to find. That was easy to do by eye. With three unknowns, and then with hundreds, it stops being easy.
Why we need an algorithm
Solving by hand works for two inputs and four rows. A real problem has many features and thousands of examples, so no one can write and solve the inequalities by hand. We want a procedure that starts with any weights and improves them until every example is on the right side. That is the perceptron learning algorithm.
Move the line yourself and see which configurations classify all four points correctly.