Tag Archives: fitness function

Prediction is chancy: Selfish Gene 1

Page 55, Selfish Gene new edition.

“Prediction in a complex world is a chancy business. Every decision that a survival machine takes is a gamble, and it is the business of genes to program brains in advance so that on average they take decisions that pay off. The currency used in the casino of evolution is survival, strictly gene survival, but for many purposes individual survival is a reasonable approximation… ”

Continue reading Prediction is chancy: Selfish Gene 1

Bit zero on Genetic Programming

When I mention genetic programming the faces of those I talk to often go a bit funny, scrunched up. They don’t get it or can’t easily understand. Fair enough. Let me try and put it simply.

What does genetic programming achieve?

Genetic programming is known for producing unusual and successful outcomes. These are often computer programs, but can be physical objects too. The odd looking NASA antennae shown here was the first artificially evolved object in space, and achieved good transmission rates for low power consumption at odd angles as the satellite flew around Earth studying the magnetosphere in the mid 2000’s. 19 06 10 NASA GP Evolved Antennae BLOGGED.png

Obviously, it depends what the outcome is that the evolution is aimed at. This video from Karl Sims is from 1994 and shows simulated virtual creatures evolved to achieve a range of outcomes. This 2014 video from Cornell University shows ‘electrophysical robots’.

Genetic programming can be used to achieve all sorts of outcomes, provided that the fitness function can be programmed.

Where did genetic programming come from?

Evolutionary approaches were started in the 1960’s in Berlin and then in the 1990’s John Koza popularised the genetic programming technique at MIT. He published big fat heavy books on the topic, including Genetic Programming II, which I have on my bookshelf, and Genetic Programming Theory and Practice II which I also have hardcopy.

Genetic programming is: “Using code to evolve code to solve a problem”

This is the way I often put it. Genetic programming uses Darwinian evolutionary approaches coded into the computer, with a clear outcome specified. The outcome defines what the evolved code you get does.

To achieve genetic programming you need:

  1. A definition of what a good outcome is (the fitness function)
  2. DNA blocks (the small bits of code you will put into the evolutionary processes)
  3. A way of evolving the individuals (the code that manages the evolution process)

Throw them at the wall, and see what sticks

The fitness function is crucial. It defines how you will select from the evolved individuals. As each individual is evolved, they are ‘thrown at the wall’, or tested using the fitness function.
Those individuals that get ‘good’ scores are kept, and breeding happens more with higher them.


The process goes on, generation after generation, following that approach. And you get graphs like this one.Blogged IMG_2017_08_05 Website from CROC_Fig_015 2D Fitness Graph

Automatic Programming

Back in the 1990’s, a term often used was ‘Automatic Programming’, i.e. instead of developers working to code a solution to the problem, this technique outputs the program without a person directly involved. Of course a human must be involved to define and set up the problem.

The subtitle for one of those books above is “Automatic Discovery of Reusable Programs”, and this is what researchers really wanted to achieve. Put another way:

“Genetic programming addresses this challenge by providing a method for automatically creating a working computer program from a high-level problem statement of the problem”

For some more detail, see below:

Continue reading Bit zero on Genetic Programming