◆ FUN & RANDOM

Learn to Walk

A creature that cannot walk, a network that cannot think, and a few hundred generations.

Nothing here is pre-trained. The creature starts with random weights and falls over, and evolution does the rest: score every creature in the population, keep the best few, make mutated copies, repeat. You can change the world while it learns — drag on the ground to raise hills, turn gravity up, make the floor slippery, or change what you are asking for entirely. Ask for distance and you get a shuffler; ask it to stay standing and you get a statue. That last part is most of applied machine learning, and you can feel it in about a minute here.

drag the ground to paint hills
generation0 best score0 distance0 m population mean0 status progress

The world, and what you are asking for

Small values refine what works. Large values explore, and forget.

Below about 0.2 the floor is ice and nothing can push off it.

Bigger searches better and takes longer per generation.

The network, thinking

Fourteen senses on the left, sixteen hidden units, four muscles on the right. Green is a positive weight or activation, red negative; thickness is magnitude. The two gait inputs are a clock — almost every creature that learns to walk here learns to use it.

Questions people ask

Is this machine learning?

Yes, though not the kind with a framework. A 14-16-4 neural network drives the joints, and evolution strategies improve it: score everyone, keep the best few, mutate copies of them. No gradients, no TensorFlow, no model download — the whole thing is a few hundred lines of arithmetic.

Why not TensorFlow.js?

Because the network is small enough that a forward pass is two loops, and evolution needs no backpropagation. Adding an autograd framework would mean about a megabyte of download to do arithmetic that fits on one screen.

Does the training happen on my device?

Entirely. Nothing is uploaded, nothing is downloaded, and there is no server involved at any point. The uploads counter in the top bar stays at 0 while it trains.

Can I share a creature I evolved?

Yes. The link carries the creature's actual weights, so it walks for the person you send it to exactly as it walked for you. Nothing is stored anywhere — the animal is in the URL.

Why does it crawl instead of walk?

Because crawling scores well and is much easier to find than walking. Ask for something else — "stay standing" or "jump high" — and you will get a different creature. Reward shaping is most of applied machine learning.

How this works & why it’s private

The body is six points joined by five distance constraints, integrated with Verlet and relaxed six times a step. Joints are driven by moving the two ends of a limb in opposite directions — equal and opposite, because a motor that only pushes the far end is a reactionless drive. The first working version of this made exactly that mistake, and evolution found it immediately: the best creature reached seventy metres a second by vibrating. Momentum now has to come from friction against the ground, which is why it has to learn to push off rather than to shake.

The brain is fourteen inputs (joint angles, angular velocities, torso tilt, foot contacts and a gait clock), sixteen hidden units with tanh, and four outputs that become target joint angles. Training is a plain evolutionary loop with Gaussian mutation and no crossover, which for a network this small costs nothing and saves a page of code.

Weights are Float32 all the way through, and that is deliberate rather than an optimisation. The simulation is chaotic: an earlier version compressed shared creatures to 16-bit, and a rounding error of two ten-thousandths per weight compounded over four hundred steps into a creature that walked seventeen metres instead of twenty-three. A shared creature that walks differently for you than for me is not the same creature, so the link carries the weights exactly.

Nothing leaves your device at any point: no model is fetched, no scores are recorded, and a creature you share is encoded into the URL itself rather than stored anywhere. Open your dev-tools Network tab and watch while it trains — the counter in the top bar stays at zero.