Machine learning 2

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.

w₁1
w₂0
b0
ABscoreneuronXOR
000off0
010off1✗
101fires1
111fires0✗

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.