tinytorch/milestones/02_1969_xor/README.md
In 1969, Marvin Minsky and Seymour Papert published "Perceptrons," a book that mathematically proved single-layer perceptrons CANNOT solve the XOR problem. This revelation killed neural network research funding for over a decade - triggering the infamous "AI Winter."
The proof was devastating: no matter how much you train, a single layer cannot learn XOR. This milestone recreates that crisis... and then shows how multi-layer networks solved it.
A demonstration of perceptron limitations and the multi-layer solution:
Run after Module 08 (Training capability)
<table> <thead> <tr> <th width="25%"><b>Module</b></th> <th width="25%">Component</th> <th width="50%">What It Provides</th> </tr> </thead> <tbody> <tr><td><b>Module 01</b></td><td>Tensor</td><td>YOUR data structure</td></tr> <tr><td><b>Module 02</b></td><td>Activations</td><td>YOUR sigmoid/ReLU activations</td></tr> <tr><td><b>Module 03</b></td><td>Layers</td><td>YOUR Linear layers</td></tr> <tr><td><b>Module 04</b></td><td>Losses</td><td>YOUR loss functions</td></tr> <tr><td><b>Module 06</b></td><td>Autograd</td><td>YOUR automatic differentiation</td></tr> <tr><td><b>Module 07</b></td><td>Optimizers</td><td>YOUR SGD optimizer</td></tr> <tr><td><b>Module 08</b></td><td>Training</td><td>YOUR end-to-end training loop</td></tr> </tbody> </table>This milestone uses crisis → solution narrative with 2 scripts:
Purpose: Demonstrate the fundamental limitation
The XOR Problem:
Inputs Output
x1 x2 XOR
0 0 → 0 (same)
0 1 → 1 (different)
1 0 → 1 (different)
1 1 → 0 (same)
These 4 points CANNOT be separated by a single line!
Purpose: Show how multi-layer networks solve it
The Solution:
Input → Hidden Layer → Output
(learns useful features)
The hidden layer learns to transform the space so XOR becomes linearly separable!
This milestone teaches the fundamental reason why deep learning works:
The XOR crisis wasn't about perceptrons being broken - it was about needing depth to solve complex problems. This realization (via backpropagation in 1986) ended the AI Winter.
cd milestones/02_1969_xor
# Step 1: Experience the crisis (run after Module 08)
python 01_xor_crisis.py
# Step 2: See the solution (run after Module 08)
python 02_xor_solved.py
After completing this milestone, you'll understand:
You've experienced the crisis that shaped neural network history!