Step 1 of 6
One line is not enough
The perceptron meets XOR
Why this matters. Every neural network, the ones that recognise speech, translate text or run ChatGPT, is made of units like these stacked in layers. This lab shows, with the smallest problem that proves it, why one unit is never enough and what a second layer buys you.
A neuron is Machine learning 1's line with one change: it fires (outputs 1) when its score w·x + b is above 0, and stays off (outputs 0) otherwise.
Here are the four inputs of a logic gate, the corners (0, 0), (0, 1), (1, 0) and (1, 1). The amber ones should fire: that is XOR, "A or B, but not both", the gate you built from AND, OR and NOT in the CPU lab.
Move the line around and see how many corners you can get right. Then answer one question: what is the most ANY straight line can get?
Amber dots should fire (XOR is 1), fuchsia squares should stay off. The neuron fires on the side its score is above 0.
| A | B | score | neuron | XOR | |
|---|---|---|---|---|---|
| 0 | 0 | 0 | off | 0 | |
| 0 | 1 | 0 | off | 1 | ✗ |
| 1 | 0 | 1 | fires | 1 | |
| 1 | 1 | 1 | fires | 0 | ✗ |
2 of 4 corners right
Once you have tried a few lines: what is the most corners ANY straight line can get right?
Sign in to save your progress.