Download Evolutionary Computing A Practical Introduction

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Dual inheritance theory wikipedia , lookup

Artificial gene synthesis wikipedia , lookup

Chromosome wikipedia , lookup

Genome evolution wikipedia , lookup

Designer baby wikipedia , lookup

Genetic engineering wikipedia , lookup

Karyotype wikipedia , lookup

History of genetic engineering wikipedia , lookup

Gene expression programming wikipedia , lookup

Polyploid wikipedia , lookup

Genome (book) wikipedia , lookup

Population genetics wikipedia , lookup

Microevolution wikipedia , lookup

Koinophilia wikipedia , lookup

Transcript
Contents
Evolutionary Computing
A Practical Introduction
n
n
n
Presented by Ben Paechter
n
Napier University
n
Natural Evolution
Evolutionary Algorithms
A Simple Example
Simple Demonstrations
How to Build an Evolutionary Algorithm
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
Natural Genetics
n
n
n
DNA and Genes
The information required to build a living
organism is coded in the DNA and other
genetic material found in the cells of that
organism
Within a species, the vast majority of the
genetic material is the same
Small changes in the genetic material give
rise to small changes in the organism
l
n
n
E.g height, hair colour
n
n
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
2
3
DNA is a large molecule made up of
fragments. There are several fragment types,
each one acting like a letter in a long coded
message:
-A-B-A-D-C-B-B-C-C-A-D-B-C-C-ACertain groups of letters are meaningful
together - a bit like words.
These groups are called genes
The DNA is made up of genes and rubbish
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
4
1
Example: Human
Reproduction
n
n
Reproductive Cells
Human DNA is organised into chromosomes
Most human cells contains 23 pairs of
chromosomes which together define the
physical attributes of the individual:
n
n
n
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
5
Sperm and egg cells contain 23 individual
chromosomes rather than 23 pairs
Reproductive cells are formed by one cell
splitting into two
During this process the pairs of chromosome
undergo an operation called crossover
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
Crossover
Fertilisation
Sperm cell from Father
During crossover the chromosome pairs link
up and swap parts of themselves:
Before
After
After crossover one of each pair goes into each cell
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
6
Egg cell from Mother
New person cell
7
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
8
2
Mutation
Theory of Evolution
l
n
n
n
Occasionally some of the genetic material
changes very slightly during this process
This means that the child might have genetic
material information not inherited from either
parent
This is most likely to be catastrophic
l
l
l
l
l
l
l
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
9
n
Evolution - search through the enormous
genetic parameter space for the best genetic
make-up
Borrow ideas from nature to help us solve
problems that have an equally large search
spaces or similarly changing environment
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
10
Evolutionary Computing
The Metaphor
Evolution as Search
n
Mutation, Crossover =>New genetic material or new
combinations.
Usually less able to to survive and so reproduce
Occasionally more able to survive and so reproduce
More reproduction leads to more of the “new improved”
genetic
“Good” sets of genes get reproduced more
“Bad” sets of genes get reproduce less
Organisms as a whole get better and better at surviving in
their environment
Evolutionists claim that this slow changing of genetic
material through reproduction, mutation and possibly
crossover has produced all the species of plants and
animals
11
Natural
Evolution
Evolutionary
Computation
Individual
Candidate Solution
Fitness
Quality
Environment
Problem
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
12
3
Simple Example
The Knapsack Problem
The Evolutionary Cycle
Selection
Parents
n
Recombination
n
Population
n
Mutation
Note: This is not the best way to solve this problem with an
evolutionary algorithm and an evolutionary algorithm is not
the best way to solve this problem!
Replacement
Offspring
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
13
Chromosome
Representation
n
n
n
An array of bits - one for
each item in the
knapsack
A “1” means - take the
item
A “0” mean don’t take
the item
The problem is to choose which items to take
in a knapsack .
Each item has a weight and a value
We want to maximise the value of the items in
the knapsack, without exceeding some
maximum weight.
14
Chromosome
Fitness Evaluation
n
CHROMOSOME
n
Add up the value of the items in the knapsack
to give the fitness.
If the knapsack is overweight, then subtract
from the fitness the amount overweight.
GENE
Create 100 random bit strings for the initial population
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
15
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
16
4
Choosing Parents to
Reproduce
n
To make a child Recombination
To choose one parent:
l
l
n
Choose two chromosomes randomly from
the population.
Whichever has the highest fitness is the
parent.
For each gene choose randomly whether to
take it from one chromosome or the other
Parents
Child
0 1 1 0 0 0 1 1
1 1 0 0 1 1 1 0
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
17
Mutation
n
n
0 1 0 0 0 1 1 1
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
18
Replacement
Give each gene a small chance of flipping say 1/(length of string)
0 1 0 0 1 1 1 1
0 1 0 0 1 1 1 1
19
When inserting a new child into the
population, choose a existing member to kill
by:
l Choosing two chromosomes randomly
from the population.
l Whichever has the lowest fitness is killed.
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
20
5
The Evolution
Mechanism
The Evolutionary Cycle
Selection
Parents
n
Recombination
Population
Increasing diversity by
genetic operators
l mutation
l recombination
n
Decreasing diversity by
selection of
l parents
l things to kill
Mutation
Replacement
Offspring
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
21
Real World EC
Advantages
Tends to include:
n More complex representations and operators
n Use of problem specific knowledge for
seeding the initial population and creating
heuristic operators
n Hybridisation with other methods
n
n
n
n
n
n
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
22
23
Handles huge search spaces
Balances exploration and exploitation
Easy to try - not knowledge intensive
Easy to combine with other methods
Provides many alternative solutions
Can continually evolve solutions to fit with a
continually changing problem
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
24
6
Disadvantages
n
n
n
n
No guarantee for optimal solution within finite
time - lacks the killer instinct
Weak theoretical basis
May need extensive parameter tuning
Often computationally expensive, i.e. slow
Evolutionary Computing - A Practical Introduction
by Ben Paechter, Napier University
25
7