CSE /CSE6602E - Soft Computing Winter Lecture 9. Genetic Algorithms & Evolution Strategies. Guest lecturer: Xiangdong An

Size: px
Start display at page:

Download "CSE /CSE6602E - Soft Computing Winter Lecture 9. Genetic Algorithms & Evolution Strategies. Guest lecturer: Xiangdong An"

Transcription

1 CSE3 3./CSE66E - Soft Computing Winter Lecture 9 Genetic Algorithms & Evolution Strategies Guest lecturer: Xiangdong An xan@cs.yorku.ca

2 Genetic algorithms J. Holland, Adaptation in Natural and Artificial Systems, 975. Sketch of the simple GA Representation Recombination Mutation Parent selection Survival selection Bit-strings -point crossover Bit flip Fitness proportional Generational

3 Simple genetic algorithms an example Maximizing x for x in the range -3, represented as a 5-bit binary string genotype phenotype Prob i =f i /Σf i f i / f String no. Initial population x value Fitness f(x)=x Prob i Expected count Actual count Sum Average Max Initialization, and parent selection 3

4 Simple genetic algorithms an example String no. Mating pool Crossover point Offspring after xover x value Fitness f(x) = x Sum 75 Average 39 Max 79 Crossover and offspring evaluation

5 Simple genetic algorithms an example String no. Offspring after xover Offspring after mutation x value Fitness f(x)=x Sum 6 Average 65.5 Max 78 Mutation and offspring evaluation 5

6 Representation of individuals Binary representations Gray coding ensures consecutive integers always have hamming distance one, i.e., two successive values differ in only one bit,,,,,,,,,, Integer representations Real-valued of floating point representations Permutation representations Eight-queens example 6

7 Mutation For binary representation Bitwise mutation rate p m Given sequence length L, Lp m bits will be mutated averagely 7

8 Mutation For integer representation Random setting (cardinal) Bitwise mutation rate p m Given sequence length L, Lp m bits will be mutated averagely Creep mutation (ordinal) Step sizes 8

9 Mutation For floating-point representation <x,, x n > <x,, x n > x i, x i [L i, U] i Uniform mutation Uniformly form range [L i, U] i Nonuniform mutation with a fixed distribution Gaussian distribution N(µ,σ ) Cauchy distribution 9

10 Mutation For permutation representation Swap mutation Insert mutation Scramble mutation Have positions of a subset values scrambled Inversion mutation Reversing the order of a range of values in the string

11 Recombination Crossover rate p c If lower than p c, recombination happens; otherwise asexually For binary (integer, floating-point) representation One-point crossover Two-point crossover (positional bias) Uniform crossover (distributional bias) For each gene position, a random number generated from [,). If smaller than, say.5, inherit from parent, otherwise parent.

12 Recombination For floating-point representation z i = αx i + (-α)y i, Simple recombination α [, ] Partial genes generated by arithmetic recombination Single arithmetic recombination Only one gene generated by arithmetic recombination Whole arithmetic recombination All genes are generated by arithmetic recombination Range of gene values in the population will be reduced due to averaging

13 Population models The generation model After each generation, the whole population is replaced by its offspring The steady-state model After each generation, only partial population is replace by its offspring 3

14 Parent selection Fitness proportional selection Premature convergence Outstanding individuals take over the entire population very quickly, i.e., genetic drift No selection pressure at later stage Ranking selection Allocating selection probability based on ranking of individuals, not fitness values Preserves a constant selection pressure

15 Survivor selection Age-based replacement Fitness-based replacement 5

16 Evolution strategies By Rechenberg and Schwefel, 96s Sketch of ES Representation Recombination Mutation Parent selection Survival selection Speciality Real-valued vectors Discrete or intermediatry Gaussian perturbation Uniform random (µ,λ) or (µ+λ) Self-adaptation of mutation step sizes 6

17 Representation Typically used for continuous parameter optimization A vector of floating-point variables <x,, x n > Objective function: R n R To self-adapt <x,, x n, σ,, σ m, α,, α m >, m n x σ α σ determines the perturbation extent, often called mutation step size. 7

18 Mutation x i =x i + N(, σ i ) Evolve σ i to get σ i first, and then use it to mutate x i Self-adaptation adjusts the mutation strategy as the search is proceeding. The underlying assumption is that at different stages of evolution, different mutation may be appropriate. 8

19 Uncorrelated mutation with one step size The same distribution is used to mutate each x i, therefore only one σ for each individual σ is mutated by a term e Г, with Г a random variable drawn each time from a normal distribution with mean and standard deviation τ Г ~ N(, τ) e Г is a lognormal distribution σ = σ e Г 9

20 Lognormal distribution

21 Recombination Intermediary recombination z i = αx i + (-α)y i, Discrete recombination z i = x i or y i, chosen randomly

22 Survivor selection After creating λ offspring, the best µ of them are chosen deterministically: From the offspring only, called (µ, λ) selection Discards all parents and in principle is able to leave local optima From the union of parents and offspring, called (µ+λ) selection Preserves outdate solutions Misadapted parameters may survive to relatively larger number of generations when having good object variables but bad strategy parameters