Perceptron Lab

Read the lesson ↓

MARK I PERCEPTRON · 1958 SIMULATION

SESSION 06 / ONLINE

Current mission

Starter mission: choose AND and click Train Burst (5).

01 Pick a rule

02 Train the line

Start with AND. The boundary moves only after a wrong guess.

Live model

Decision space

Learning

Dots are examples. The dark line is the model. Red rings reveal its current mistakes.

  • Square = class 0
  • Circle = class 1
  • Ring = current mistake
Input probe

Test one dot

03

Set a coordinate and ask the trained model which class it predicts.

X1 1.0

X2 0.0

  • GUESS SCORE: 0.20
  • OUTPUT: 1
  • LINE CUT POINT: 0.20
  • CASE STATUS: AND: WORKING CASE

ACCURACY 0%

Accuracy = examples sorted correctly out of 4.

Under the hood

Read the decision

04
0.40×1.0 + 0.40×0.0 + −0.20 → 0 or 1

Weights amplify the inputs. Bias nudges the starting position. Together they decide which side of the line a dot lands on.

How the learning rule works

w ← w + η × error × x

Every wrong guess adjusts the weights. Correct guesses leave the line alone.

1958 hardware vs. modern training

The 1958 mode adds mild channel noise and slower feedback. The 2012 mode is faster and cleaner—but this model still has only one boundary.

OPEN LAB LOG + DIAGNOSTICS

Inspect every prediction, error, and training round.

  • DATASET ACCURACY: 0 / 4
  • ROUNDS TRAINED: 0
  • ONE-LINE CHECK: VISUAL CHECK
LAB LOGBOOK
x1x2targetprederror
The limit

Can you beat XOR?

Its matching classes sit on opposite corners. Rotate and slide one line however you like—there will always be a mistake.

The fix

Two lines beat XOR

One straight boundary can't split XOR. Two can — if you combine them the right way. This is what a hidden layer buys you.

AI ORIGINS · INTERACTIVE LAB 06

Teach a machine
with one line.

Train a 1958 perceptron, watch its boundary move, and discover the pattern it can never learn alone.

Launch the experiment 15–25 min · No code required

Limit Notes

WHAT THIS IS

A perceptron is a small guess machine. It learns by moving one straight line.

WHAT IT CAN'T DO

XOR cannot be solved by one line in two dimensions. This is a structural limit, not just undertraining.

HOW TO USE IT LIKE IT'S 1958

  • Set channels to (1,0). Run.
  • Try 0.1 learning rate first. Watch what changes.
  • Adjust W1 upward until output flips.
  • Switch to XOR. Can you draw one line that separates all points? Try.

Worked Example: Hand-Calculating a Perceptron Update

Trace the mathematics of Frank Rosenblatt's 1958 learning rule step by step on a single misclassified coordinate.

Sample Problem: Training on Coordinate (1, 1) for Logical AND

Suppose our perceptron is learning the logical AND function. Current weights are \(w_1 = 0.4\), \(w_2 = 0.4\), with bias \(b = -1.0\), and the learning rate is \(\eta = 0.2\). We present training sample \(\mathbf{x} = (1, 1)\), whose true target is \(y = 1\). How does the unit calculate its output, and how does the line move?

  1. Step 1: Compute the weighted linear sum (\(z\)).
    \(z = w_1 x_1 + w_2 x_2 + b = (0.4)(1) + (0.4)(1) + (-1.0) = 0.8 - 1.0 = -0.2\).
  2. Step 2: Apply the step activation function.
    Because \(z = -0.2 < 0\), the threshold function outputs \(\hat{y} = 0\). This means the perceptron predicted class 0, but the ground truth was class 1.
  3. Step 3: Calculate the classification error.
    \(\text{error} = y - \hat{y} = 1 - 0 = +1\). Because the error is non-zero, the weights must be adjusted in order to correct the decision boundary.
  4. Step 4: Update weights and bias using the learning rule.
    \(\Delta w_i = \eta \cdot \text{error} \cdot x_i\)
    \(w_{1,\text{new}} = 0.4 + (0.2)(+1)(1) = 0.6\)
    \(w_{2,\text{new}} = 0.4 + (0.2)(+1)(1) = 0.6\)
    \(b_{\text{new}} = -1.0 + (0.2)(+1) = -0.8\)
    Mechanism: Because the weights and bias increased, the decision boundary line shifted closer to \((1, 1)\). On the next epoch, testing \((1, 1)\) gives \(z = (0.6)(1) + (0.6)(1) - 0.8 = +0.4 > 0\), which results in \(\hat{y} = 1\) (correctly classified).

Self-Check Question

If a perceptron predicts \(\hat{y} = 1\) for input \((1, 0)\) when the true label is \(y = 0\), what is the error \(e = y - \hat{y}\), and will the weights increase or decrease?

Show Answer & Explanation

Answer: The error is \(0 - 1 = -1\). Because the error is negative, \(\Delta w_1 = \eta(-1)(1) = -\eta\), which means the weight \(w_1\) will decrease. This happens because the neuron overfired, therefore reducing the weights pushes the activation below the threshold in order to prevent false positives.

Sources & Further Reading

Foundational primary research in neural networks and computational learning theory.

  • 1958 Primary Paper Rosenblatt, Frank. “The Perceptron: A Probabilistic Model for Information Storage and Organization in the Brain.” Psychological Review, 65(6), 386–408 (1958). doi:10.1037/h0042519. Introduced the mathematical model and learning theorem.
  • 1969 Geometric Limit Minsky, Marvin, & Papert, Seymour. Perceptrons: An Introduction to Computational Geometry. MIT Press (1969). Proved that single-layer perceptrons cannot compute non-linear predicates like parity or XOR.
  • 1986 Multi-Layer Revival Rumelhart, David E., Hinton, Geoffrey E., & Williams, Ronald J. “Learning representations by back-propagating errors.” Nature, 323, 533–536 (1986). doi:10.1038/323533a0. Generalized the learning rule across hidden layers.
  • Historical Hardware U.S. Office of Naval Research archives. “Mark I Perceptron” documentation, Cornell Aeronautical Laboratory (1958–1960).

From One Neuron to Robot Brains

Stack millions of these units and you get the networks behind deep reinforcement learning. Robots use them to learn to walk, grasp, and fly by trial and error. Watch the table-based version learn in the Robot Reinforcement Learning lab, then imagine a network replacing the table.

History Panel: Mark I Perceptron (1958)

The specific machine demonstrated in 1958 was the Mark I Perceptron — and the idea it introduced never left. It's still the basic unit inside every modern neural network you use today.

Machine Context

  • ScientistFrank Rosenblatt
  • InstitutionCornell Aeronautical Laboratory
  • Funded ByU.S. Office of Naval Research
  • Hardware ContextSimulated first on an IBM 704, then built as a physical machine
  • Physical MachineMark I Perceptron

Perceptron is the model. Mark I Perceptron was the physical machine.

How It Was Actually Built

Eyes: a 20×20 grid of 400 photocells, wired randomly to input units, acted as its "retina."

Weights: not numbers in software — physical potentiometers, one per connection. Learning: electric motors turned those potentiometer dials whenever a guess was wrong, mechanically carrying out the same w = w + η × error × x rule you used above.

Task: tell simple shapes apart, like a square from a triangle held in front of the camera.

Every slider you dragged above stands in for a motor that once physically turned a dial.

The Hype — and the Limit That Stopped It

In 1958 the New York Times reported the Navy expected the perceptron to eventually "walk, talk, see, write, reproduce itself and be conscious of its existence." Funding poured in.

In 1969, Marvin Minsky and Seymour Papert published Perceptrons, mathematically proving that a single-layer perceptron can never solve a problem like XOR — the exact limit you just tested in the XOR challenge tab above. Funders read it as a verdict on neural networks generally, funding dried up, and the field entered what's now called the first AI winter, lasting into the early 1980s.

The book was right about single-layer perceptrons — but wrong that the idea was a dead end. It just needed more than one layer.

How It's Used to Your Advantage Today

The fix hiding in plain sight was the one you already built: stack perceptron-like units into layers, like the OR-and-NAND combination in the two-layer XOR solver. Every layer draws its own boundaries; combined, they carve out shapes no single line could.

That single idea, scaled up, is the basic unit of every modern neural network — image recognizers sorting photos, voice assistants parsing speech, recommendation engines, and the large language models behind tools like this one. Each is millions of perceptron-style units (weighted sum → threshold-like activation) arranged in many layers, trained with backpropagation: a generalization of the exact error-driven update rule you trained with above, just spread across every layer instead of one.

You didn't just simulate a 1958 artifact — you rebuilt the smallest working piece of the systems training today's AI.

Where It Sits on the Timeline

  1. Turing proposes the imitation game
  2. Mark I Perceptron is demonstrated
  3. ELIZA demonstrates scripted NLP conversation
  4. Minsky & Papert's Perceptrons triggers the first AI winter
  5. Expert systems expand symbolic AI
  6. Backpropagation popularized for training multi-layer networks
  7. Deep learning breakthroughs revive neural methods at scale

Lesson Outputs

Each team should publish a short reflection and demo link at the end of class.