This was an experiment I did one afternoon with neural networks and evolutionary algorithms. I was working towards a robot controller that could figure out how to walk on its own and keep going even over uneven terrain, but I got distracted watching the different gaits it was producing and didn't actually make the robot controller. The different gaits are still pretty cool though.
The biped "robot" is simulated using a simple 2D rig of boxes and joints and the "brain" (which generates the walking gait) is simulated using a simple one-layer neural network. The algorithm searches for a good gait by running trials using 20 gaits at a time and scoring each gait based on how far the center of mass got in 20 seconds. The initial gaits are random but the gaits in subsequent trials consist of mutated versions of the gaits from the previous trial. The only input to the neural network is the regular pulse of a few cosine waves and the neural network only has one layer so it's more like a wind-up toy than a robot. I tried adding more neuron layers and more inputs like limb angles and whether the feet are touching the ground but the algorithm ended up ignoring it so I took it back out. I also tried making the trial length 10 seconds instead of 20 seconds but that ended up with gaits that lunged forward right before the 10 second mark to get a better score.
The search was able to find something that looks like walking, but that ended up being one of the slowest gaits discovered. Here are some interesting gaits sorted in order of increasing score:
And finally, all of them racing together: