evolutionary computing

33
Evolutionary Computing Evolutionary Computing Consider the spectacular results Consider the spectacular results of biological evolution of biological evolution Designs better than any other known Designs better than any other known Adaptive to changing requirements Adaptive to changing requirements Natural Selection works the same Natural Selection works the same way regardless of the application way regardless of the application Algorithm is relatively unaware of Algorithm is relatively unaware of application application Making it “more” aware may improve Making it “more” aware may improve performance performance

Upload: qamar

Post on 08-Feb-2016

46 views

Category:

Documents


6 download

DESCRIPTION

Evolutionary Computing. Consider the spectacular results of biological evolution Designs better than any other known Adaptive to changing requirements Natural Selection works the same way regardless of the application Algorithm is relatively unaware of application - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Evolutionary Computing

Evolutionary ComputingEvolutionary Computing Consider the spectacular results of Consider the spectacular results of

biological evolutionbiological evolution• Designs better than any other knownDesigns better than any other known• Adaptive to changing requirementsAdaptive to changing requirements

Natural Selection works the same Natural Selection works the same way regardless of the applicationway regardless of the application• Algorithm is relatively unaware of Algorithm is relatively unaware of

applicationapplication Making it “more” aware may improve Making it “more” aware may improve

performanceperformance

Page 2: Evolutionary Computing

Evolutionary Computing Evolutionary Computing (Limitations)(Limitations)

Simulation of Natural Selection On a Simulation of Natural Selection On a Smaller ScaleSmaller Scale• Can’t wait millions of years for evolutionCan’t wait millions of years for evolution

Computer are fast and getting fasterComputer are fast and getting faster EC works well on distributed computer architecturesEC works well on distributed computer architectures

• Population sizes are much more limitedPopulation sizes are much more limited• Actual evolutionary process is very complex – Actual evolutionary process is very complex –

we can only approximate the processwe can only approximate the process Process is not fully understoodProcess is not fully understood More accurate approximation requires additional More accurate approximation requires additional

computation resourcescomputation resources

Page 3: Evolutionary Computing

Simple Genetic AlgorithmsSimple Genetic Algorithms

General Technique for multi-variable General Technique for multi-variable function optimization and machine function optimization and machine learninglearning

Example: Design an airplane wingExample: Design an airplane wingVariables:Variables:

length, width, rotation in x-axis, length, width, rotation in x-axis, rotation in y-axisrotation in y-axis

Page 4: Evolutionary Computing

Example – Design an airplane wingExample – Design an airplane wing

VariablesVariables• Wing length (l)Wing length (l)• Wing Width (w)Wing Width (w)• Sweep Angle (s)Sweep Angle (s)• Pitch Angle (p)Pitch Angle (p)

Page 5: Evolutionary Computing

Fitness Function for Airplane WingFitness Function for Airplane Wing

Fitness(l,w,s,p) = Efficiency(l,w,s,p) = Fitness(l,w,s,p) = Efficiency(l,w,s,p) = lift(l,w,s,p) / drag(l,w,s,p)lift(l,w,s,p) / drag(l,w,s,p)• This is an extreme simplification, and I don’t This is an extreme simplification, and I don’t

know anything about designing airplane wings, know anything about designing airplane wings, but an aerospace engineer can give us the but an aerospace engineer can give us the proper input variables and efficiency functions proper input variables and efficiency functions and that is what we would use.and that is what we would use.

• Real case would have many more variables Real case would have many more variables and a complex fitness function – perhaps a and a complex fitness function – perhaps a wind tunnel simulation.wind tunnel simulation.

Page 6: Evolutionary Computing

What is the Range of Each What is the Range of Each Variable?Variable?

LengthLength• Range 0 to 16 meters Range 0 to 16 meters

4-bits provides a 1 meter resolution4-bits provides a 1 meter resolution 5-bits would provides a .5 meter resolution 5-bits would provides a .5 meter resolution

WidthWidth• Range 0 to 8 feetRange 0 to 8 feet

3-bits provides a 1 foot resolution3-bits provides a 1 foot resolution Sweep angleSweep angle

• Range 0 to 180 DegreesRange 0 to 180 Degrees 4-bits provides a 180/16 degree resolution4-bits provides a 180/16 degree resolution

Pitch anglePitch angle• Range -90 to 90 degreesRange -90 to 90 degrees

5-bits provides a 180/32 degree resolution5-bits provides a 180/32 degree resolution

Page 7: Evolutionary Computing

Genetic Representation of Airplane Genetic Representation of Airplane WingWing

4 bits for length4 bits for length 3 bits for width3 bits for width 4 bits for sweep angle4 bits for sweep angle 5 bits for pitch angle5 bits for pitch angle

Total of 16 bits to Total of 16 bits to describe all 4 describe all 4 variablesvariables

Any random 16 bit Any random 16 bit value completely value completely describes particular describes particular values for an airplane values for an airplane wing.wing.

Page 8: Evolutionary Computing

Create a population of random Create a population of random airplane wing stringsairplane wing strings

Select a population size. Select a population size. • Let’s use 500 for our airplane wing.Let’s use 500 for our airplane wing.

Create 500 random 16-bit values.Create 500 random 16-bit values.• Each 16-bit value represents the Each 16-bit value represents the stringstring for an for an

experimental aircraft wingexperimental aircraft wing• The fitness function can provide a measure of The fitness function can provide a measure of

the quality of each of or 500 experimental the quality of each of or 500 experimental wingswings

Because the values were generated randomly, most Because the values were generated randomly, most wings will be pretty bad and have low fitness values, wings will be pretty bad and have low fitness values, but some will be better than othersbut some will be better than others

Page 9: Evolutionary Computing

TerminologyTerminology String - Sequence of genetic String - Sequence of genetic

information fully describing an information fully describing an individual in the population.individual in the population.

Gene – location of a bit on a stringGene – location of a bit on a string Allele – value of a geneAllele – value of a gene

Page 10: Evolutionary Computing

Natural SelectionNatural Selection As in the natural worldAs in the natural world

• The more fit members of the population The more fit members of the population have a greater probability of have a greater probability of propagating their genes into the next propagating their genes into the next generationgeneration

Page 11: Evolutionary Computing

Creating the Gene Pool for the Creating the Gene Pool for the Next GenerationNext Generation

More fit members should be more More fit members should be more prominent in the gene poolprominent in the gene pool

Less fit members should not be Less fit members should not be completely excludedcompletely excluded• Excluding the less fit might remove Excluding the less fit might remove

important gene subsequences from the important gene subsequences from the gene poolgene pool

• Converging too quickly to a solution can Converging too quickly to a solution can provide suboptimal resultsprovide suboptimal results

Page 12: Evolutionary Computing

ReproductionReproduction Select 500 Select 500

members of the members of the gene pool where gene pool where the probability of the probability of the ithe ithth member of member of the population the population being selected is:being selected is:

j

jfitnessifitnessiselectp)()())((

Page 13: Evolutionary Computing

Reproduction (continued)Reproduction (continued)

Once the 500 members of the gene Once the 500 members of the gene pool for the next generation is pool for the next generation is established, pairs of parents are established, pairs of parents are selected randomly. To distinguish selected randomly. To distinguish between the two parents we will between the two parents we will designate one as the father and the designate one as the father and the other as the mother, although their other as the mother, although their functions are identical.functions are identical.

Page 14: Evolutionary Computing

Reproduction (continued)Reproduction (continued) Each pair of parents creates two Each pair of parents creates two

children using one of two methodschildren using one of two methods• CloningCloning

One child is an exact copy of the fatherOne child is an exact copy of the father One child is an exact copy of the motherOne child is an exact copy of the mother

• CrossoverCrossover Some bits are copied from the mother, some Some bits are copied from the mother, some

from the fatherfrom the father Copy from one parent until you reach a Copy from one parent until you reach a

crossover pointcrossover point, then copy from the other , then copy from the other parent.parent.

Page 15: Evolutionary Computing

Crossover with Single Crossover Crossover with Single Crossover PointPoint

Father Father

MotherMother

Child 1Child 1

Child 2Child 2

00 00 00 00 00 00 00 00

11 11 11 11 11 11 11 11

00 00 00 00 11 11 11 11

11 11 11 11 00 00 00 00

Page 16: Evolutionary Computing

Crossover with Three Crossover Crossover with Three Crossover PointsPoints

Father Father

MotherMother

Child 1Child 1

Child 2Child 2

00 00 00 00 00 00 00 00

11 11 11 11 11 11 11 11

00 11 11 00 00 00 11 11

11 00 00 11 11 11 00 00

↓ ↓ ↓

Page 17: Evolutionary Computing

MutationMutation Each bit copied to a child has a Each bit copied to a child has a

probability of being changed (from 1 probability of being changed (from 1 to 0, or 0 to 1).to 0, or 0 to 1).

Usually the probability of mutation is Usually the probability of mutation is relatively low, but enough to relatively low, but enough to encourage diversity.encourage diversity.

In other models, mutation is the In other models, mutation is the principal method of genetic change.principal method of genetic change.

Page 18: Evolutionary Computing

Summary of Simple Genetic Summary of Simple Genetic AlgorithmAlgorithm

Create a population of random genes Create a population of random genes For a specified number of generationsFor a specified number of generations

• Apply the fitness function to each member of the Apply the fitness function to each member of the populationpopulation

• Biasing toward the more fit individuals, create a Biasing toward the more fit individuals, create a pool of parentspool of parents

• While there are not a number of children equal While there are not a number of children equal to the original population sizeto the original population size

Randomly select two parents and create two children Randomly select two parents and create two children either using cloning or crossovereither using cloning or crossover

Apply mutationApply mutation• Completely replace the current generation with Completely replace the current generation with

the childrenthe children

Page 19: Evolutionary Computing

Basic Parameters for a Genetic Basic Parameters for a Genetic AlgorithmAlgorithm

Population sizePopulation size Gene LengthGene Length Number of crossover pointsNumber of crossover points Probability of using crossover vs. cloningProbability of using crossover vs. cloning Number of generationsNumber of generations Scaling FactorsScaling Factors More Complex/ Powerful applicatoin More Complex/ Powerful applicatoin

specific modificationsspecific modifications

Page 20: Evolutionary Computing

SchemaSchema AA Schema Schema is a similarity template is a similarity template

describing a subset of strings with describing a subset of strings with similarities at certain string positionssimilarities at certain string positions• Consists of series of 1’s, 0’s, and *’s (for don’t Consists of series of 1’s, 0’s, and *’s (for don’t

care)care)• Examples:Examples:

1**1**• Matches (100, 101, 110, 111)Matches (100, 101, 110, 111)

*10***10**• Matches (01000, 01001, 01010, 01011,Matches (01000, 01001, 01010, 01011,

11000, 11001, 11011, 11011)11000, 11001, 11011, 11011)

The plural of the word The plural of the word schemaschema is is schemata.schemata.

Page 21: Evolutionary Computing

Counting SchemataCounting Schemata For a binary schema of length k, there are For a binary schema of length k, there are

33kk possible schemata possible schemata• Each position may contain 0, 1, or *Each position may contain 0, 1, or *

A binary string of length k can have A binary string of length k can have membership in 2membership in 2kk different schemata different schemata• Each position can contain the actual string Each position can contain the actual string

digit, or *digit, or * ExampleExample

• 101 has membership in schemata (101, 10*, 1*1, 1**, 101 has membership in schemata (101, 10*, 1*1, 1**, *01, *0*, **1, ***)*01, *0*, **1, ***)

Schemata per populationsSchemata per populations• Range from 2Range from 2kk (all strings are the same) to n*2 (all strings are the same) to n*2kk

(all strings have different schemata)(all strings have different schemata)

Page 22: Evolutionary Computing

Schema TermsSchema Terms Schema Schema order order o(H) is the number of fixed o(H) is the number of fixed

valuesvalues• Number of 1’s and 0’sNumber of 1’s and 0’s

0**10 has an order of 30**10 has an order of 3 0*1*11* has an order of 40*1*11* has an order of 4

Schema Schema defining lengthdefining length δδ(H) is the (H) is the distance between first and last fixed valuedistance between first and last fixed value• Number of positions where crossover can Number of positions where crossover can

disrupt the schemadisrupt the schema 0**10 has a defining length of 40**10 has a defining length of 4 0*1*11* has defining length of 50*1*11* has defining length of 5 **1*1*1 has a defining length of 4**1*1*1 has a defining length of 4 00**01*0 has a defining length of 700**01*0 has a defining length of 7

Page 23: Evolutionary Computing

Effect of Reproduction on Expected Effect of Reproduction on Expected Number of Schemata in PopulationNumber of Schemata in Population

A particular schema grows as the ratio A particular schema grows as the ratio of average fitness of the schema to of average fitness of the schema to average fitness of the populationaverage fitness of the population• m examples of a particular schema H at m examples of a particular schema H at

time t is m(H, t)time t is m(H, t)

f

HftHmtHm

)(),()1,(

Page 24: Evolutionary Computing

Reproduction of Fit SchemataReproduction of Fit SchemataSuppose a particular schema H remains above Suppose a particular schema H remains above

average an amount c.average an amount c.

),(*)1()(),()1,( tHmcffcftHmtHm

Starting at t=0 and assuming a stationary value of c, we obtain

tcHmtHm )1(*)0,(),(

Reproduction allocates exponentially increasing and decreasing numbers of schemata to future generations!

Page 25: Evolutionary Computing

Schema Disruption Due to Schema Disruption Due to CrossoverCrossover

PPss = Probability of = Probability of surviving crossoversurviving crossover

PPdd = Probability of being = Probability of being destroyed by crossoverdestroyed by crossover

PPcc = Probability of = Probability of crossover versus cloningcrossover versus cloning

ll is the length of the is the length of the stringstring

δδ(H) is the defining (H) is the defining length of the schemalength of the schema

1)(*1

lHPP cs

Page 26: Evolutionary Computing

Schema Disruption Due to MutationSchema Disruption Due to Mutation

PPmm = Probability of mutating each bit = Probability of mutating each bit o(H) is the schema order (number of o(H) is the schema order (number of

fixed values)fixed values)

Probability a particular schema is Probability a particular schema is disrupted by mutation isdisrupted by mutation is

(1-p(1-pmm))o(H) o(H)

For very small values of pFor very small values of pmm, we can , we can approximate this to 1 – o(H)papproximate this to 1 – o(H)pmm

Page 27: Evolutionary Computing

Fundamental Theorem of Genetic Fundamental Theorem of Genetic AlgorithmsAlgorithms

])(1)(1[)(*),()1,( mc pHo

lHp

fHftHmtHm

Short, low-order, above-average schemata receive exponentially increasing trials in subsequent generations.

Page 28: Evolutionary Computing

Position of Bits on the Gene is Position of Bits on the Gene is ImportantImportant

Allow this to evolve as wellAllow this to evolve as well• Dynamically change the location of each Dynamically change the location of each

bit of the genebit of the gene InversionInversion

• Select subsequences of the gene and invert the Select subsequences of the gene and invert the data and the interpretationdata and the interpretation

Has no effect on the genetic content, just the Has no effect on the genetic content, just the way the information is stored.way the information is stored.

Requires additional meta-information to be Requires additional meta-information to be stored that describes the location of each bit.stored that describes the location of each bit.

Page 29: Evolutionary Computing

Inversion ExampleInversion Example

00 11 22 33 44 55 66 77 88 99 1010 1111 1212 1313 1414 1515

00 11 11 11 00 00 11 00 11 11 00 11 11 00 00 00

00 11 22 33 44 99 88 77 66 55 1010 1111 1212 1313 1414 1515

00 11 11 11 00 11 11 00 11 00 00 11 11 00 00 00

Randomly select two points in the sequence for inversion. This example, uses 5 and 9. The bit numbers and the data are inverted. Now bits 4 and 9 are adjacent and less likely to be disrupted with crossover.

Page 30: Evolutionary Computing

Inversion Complicates CrossoverInversion Complicates Crossover

44 55 99 00 1111 1212 11 1313 1414 1010 1515 22 33 66 77 88

00 11 11 11 00 00 11 00 11 11 00 11 11 00 00 00

00 11 22 33 44 99 88 77 66 55 1010 1111 1212 1313 1414 1515

11 11 11 00 00 11 00 00 11 11 11 11 11 00 00 11

How do we combine these two genes with different bit orders?• Insist that parents have same organization (not very good)• Discard if crossover yields duplicate bit numbers• Reorder one parent, chosen at random, to match the other • Reorder the less fit of the two parents to match the other

Page 31: Evolutionary Computing

When Might GA provide a Good When Might GA provide a Good Solution?Solution?

Highly multimodal functionsHighly multimodal functions Discrete or discontinuous functionsDiscrete or discontinuous functions High-dimensional functions, including High-dimensional functions, including

many combinatorial onesmany combinatorial ones Nonlinear dependence on parameters Nonlinear dependence on parameters

(interactions among parameters) – (interactions among parameters) – epistasis makes it hard for othersepistasis makes it hard for others

Often used for approximate solutions to Often used for approximate solutions to NP-complete combinatorial problemsNP-complete combinatorial problems

From Introduction to Genetic Algorithms Tutorial, Erik D. Goodman, Gecco 2005

Page 32: Evolutionary Computing

Flavors of Evolutionary ComputingFlavors of Evolutionary Computing

Genetic Algorithms (GA)Genetic Algorithms (GA) Evolutionary Programming (EP)Evolutionary Programming (EP) Classifier SystemsClassifier Systems Evolving Neural NetworksEvolving Neural Networks Genetic Programming (GP)Genetic Programming (GP) Artificial Life (AL)Artificial Life (AL)

Page 33: Evolutionary Computing

AcknowledgementAcknowledgement

Schema theory equations from David Schema theory equations from David E. Goldberg’s, E. Goldberg’s, Genetic Algorithms in Genetic Algorithms in Search, Optimization and Machine Search, Optimization and Machine LearningLearning..