Machines that learn, on the Atari® 2600

HANDS-ON AI LAB

ONE NEURON DRAWS ONE STRAIGHT LINE.
SOME QUESTIONS NEED MORE.

Early AI ideas, cut down until they run on a console from 1977, each with knobs to turn. The first room trains a real neural network on the console's own processor, a 6507 at 1.19 MHz. The cartridge has no processor of its own.

Early build: 2 rooms so far 128K 3E cartridge NTSC

Iced or hot after training: a map lit in the top left and bottom right corners, and the line SURE AFTER 197 EPOCHS

Iced or hot, learned: a hot drink on a cold day, an iced one on a hot day.

PLAY IT HERE

Press POWER ON. Up and down choose a room, Space enters it, and Space again starts it. Space runs and pauses. While a room is paused, left and right choose a knob and up and down change it. SELECT goes back to the menu. In the Chaos game the arrow keys move a corner while it runs. The emulator is Stellerator, by Christian Speckner.

THE MOMENT: ICED OR HOT

You enjoy an iced drink on a hot day and a hot drink on a cold day. Across the map is how hot the day is; up is how hot the drink is. Lit means you will enjoy it. The room starts with one neuron and lets you watch it try.

One neuron after 479 epochs: everything lit except the bottom left, and RIGHT 3/4

One neuron, 479 epochs. It has settled on "anything hot is good", is sure a hot drink on a hot day is lovely, and stays at three right out of four however long it runs. One neuron can only split the map with one straight line.

Two hidden neurons: opposite corners lit, SURE AFTER 197 EPOCHS

Set HIDDEN to 2 and run it again. In 197 epochs the hot-hot corner goes dark, two opposite corners stay lit, and it says SURE. Same drinks, same rule for learning. One more layer.

The sums are exact. Every weight on the console equals the same network worked out in Python, step for step, checked by a script beside the code.

ORDER FROM DICE: THE CHAOS GAME

A dot jumps half way to a corner picked by dice, again and again. Nothing in that rule mentions a shape. Watch what the dice draw, then move a corner with the stick, or change the rule.

A triangle made of smaller triangles, drawn in dots, with DOTS 1364 under it

Three corners, 1,364 random jumps. No dot ever lands in the middle triangle. With four corners the same rule fills the square with fog, until the dice are forbidden the same corner twice.

A pentagon made of five smaller pentagons, each made of five more

Five corners, each jump .62 of the way: a pentagon of pentagons. The cartridge's picture is checked dot for dot against the same rule in Python.

THE ROOMS

The plan is about 35 rooms behind one menu, each one idea you can play with in 90 seconds. Two are built. Several come from Michael Borck's AI Toys for his students, and keep their names.

MACHINES THAT LEARN

  • Iced or hot: playable now
  • One neuron and Perceptron
  • The drink mixer
  • Matchboxes: hexapawn and MENACE
  • Mouse in a maze
  • Memory that repairs
  • K-means stepper
  • Decision tree
  • Ball on a slope
  • Squares (best fit)
  • Twenty questions

SIMPLE RULES, LIFELIKE RESULTS

  • Life
  • Flock
  • Langton's ant
  • One-line worlds
  • Wires and brains
  • Breeding

DATA AND DOUBT

  • Threshold dial
  • Datasaurus
  • Mean vs median
  • Rigged exam (overfit)

CHANCE AND BELIEF

  • Darts for pi
  • Peg board
  • Random walkers
  • Biased coin
  • Twelve steps

SEARCH, SHAPE AND WORDS

  • Chaos game: playable now
  • Mandelbrot and Julia
  • Shortest route
  • Nearly English
  • Next word
  • ELIZA
  • Tiny transformer

HOW IT FITS

No processor in the cartridge128K of program in 64 slices and up to 32K of memory, switched by the 3E scheme. The console's 6507 does every sum.
A network in 85 bytesWeights in 16 bits, activations in 8, one exact multiply from a table of squares in 119 cycles, and two 256-byte tables for the curve.
Checked against a referenceEvery weight after every step equals the Python model's, from 0 to 4 hidden neurons. A broken table byte makes the check fail, as it should.
Every frame countedAll 262 lines, frame after frame, in a cycle-exact emulator. Training is cut into units that fit the time between pictures.

DOWNLOAD