CSE CSE 460 460 Evolutionary Evolutionary Methods Methods In this section we will look at evolutionary methods •Genetic Algorithms •Evolution Strategies •Genetic Programming •Constraints in Evolutionary Methods
References References •Lots of material at Encore (also lists all the relevant classical texts) http://www.cs.bham.ac.uk/Mirrors/ftp.de.uu.net/EC/clife/ •The Santa Fe Institute (www.sfi.edu) hosts a comprehensive overview: ftp://alife.santafe.edu/pub/USER-AREA/EC/GA/papers/over93.ps.gz ftp://alife.santafe.edu/pub/USER-AREA/EC/GA/papers/over93-2.ps.gz •Book recommendation “How to solve it: Modern Heuristics” by Z. Michalewicz and D.B. Fogel Springer-Verlag, 1999 “Genetic Algorithms” by C. Reeves and J.E. Rowe, Kluwer, 2003. •Genetic Algorithms became “famous” with the seminal publication J.H. Holland. “Adaption in Natural and Artificial Systems”. Univ. of Michigan Press, Ann Arbor/MI, 1975. •Note that evolutionary computing ideas were already around in the 1950s D.B. Fogel (Ed.). “Evolutionary Computation: The Fossil Record”. IEEE Press, Piscataway/NJ, 1998.
Evolutionary Evolutionary Methods Methods in in Context Context Optimization Methods multiple candidates single candidate (population) stochastic+competition deterministic Stochastic (Evolutionary Algorithms) (Tabu) (SA)
“Natural Natural Selection Selection” Basic Idea: Average population fitness increases due to “Survival of the Fittest” •Generate a set of candidate solutions (“population”) •Evaluate each population member •Rank population members •Let the best members survive, “kill” remaining members •Generate new candidates to fill up population (“offsprings”) Example: Color Matching Task: find the color code for a given color. Candidates: represented as 8-bit RGB color ci=(Red, Green, Blue) genotype with integer numbers Red, Green, Blue such that 0 <= Red+Green+Blue <= 255. Evaluation: display the corresponding RGB color phenotype Selection: pick the n candidates of current candidates that are perceived as the colors most similar to the target color. Generation: slighlty vary the values in the selected candidates
GA - GA - Pseudocode Pseudocode procedure evolutionary algorithm begin t := 0; initialize P(t); Properties evaluate P(t); while (t<t_max and not “good enough”) do •inherently parallel begin •adaptive t := t+1; •anytime behaviour select P(t) from P(t-1); alter P(t) crossover and mutation; evaluate P(t); end; end.
Fitness Fitness Evaluation Evaluation Fitness can be evaluated in various ways •objective function f : Phenotype / Genotype -> R •interaction with a human user (cf. color matching) •interaction with a real or computational environment (testing) e.g. evolution of neural networks •direct competition with another simulated, evolving environment (co-evolution) often the fitness of an (evolving) agent depends on the reactions of another (also evolving) agent who counters the first agent’s actions. In these cases we can evolve two inter-dependent populations of agents together and put them in direct competition. Example Design an optimum “call rate plan” for a mobile phone provider Customer reactions depend on available competitors’ call plans. Solution: Evolve call plans for all companies simultaneously. (Develop a plan based on projected opponents’ strategies).
Crossover Crossover Genotypes are usually represented as one-dimensional arrays RGB colour 222 143 076 174 013 156 222 013 156 174 143 076 1-point crossover
Mutation Mutation Random Change in one or several of the genes RGB colour 222 143 076 add random variable Mutation on green to Green channel
3-Sat 3-Sat with with GAs GAs p ( v K x ) ( x 10 ∨ x 14 ∨ x 5 ) ( x 10 ∨ x 5 ) = ∧ ∧ K ( x 14 ∨ x 5 ) ¬ x 10 ∧ ∧ ∧ the population can conveniently be represented as binary strings ... 0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 ... initial population: generate at random
Fitness Fitness Function Function 3-SAT 3-SAT Crossover and mutation functions are immediate •simple n-point crossover and •mutation by random bit-flips Fitness function •must tells us “how good” a solution is •more difficult to define, since p(x*) -> {0,1} Possible: Count the number of disjunctive subterms that are fulfilled. Note: This is a heuristic choice only, no guarantee that this leads to a solution
GA GA for for TSP TSP f e a h g b c d a b c d e f g h a b c d g f e h 1 2 3 4 5 6 7 8 1 2 3 4 7 6 5 8 Representation binary chromosomes? unsuitable! ordinal representation list of cities Initial Population generate random permutations of a list of all cities
Crossing Crossing Repair Repair Mutation Mutation a b f e d c a+c<e+f and b+d<e+f “an uncrossed path is always shorter than a crossed path” •mutation by “crossing repair”: crossed (longer) paths will be eliminated by selection equivalent 2-exchange •crossover more difficult to define: risk of incorrect tours a b c d e f g h a b c d g f e h a b c d a b c d e f g h g f e h
GA GA for for NLP NLP n cos n cos 4 ( x i ) − 2 Π i = 1 2 ( x i ) ∑ i = 1 maximize G 2( x ) = n i ⋅ x i 2 ∑ i = 1
GA GA for for NLP NLP x1 x2 x3 x4 ... xn Representation: Array of floats Offsprings: Add (Gaussian) random variable to each component (standard deviation σ , mean m) 1 − ( x − m ) 2 /(2 σ 2 ) f ( x ) = σ 2 π e If m =0, the offsprings will (statistically) be similar to the parent provided the standard deviation is not too high. High standard deviation results in “random search”. The Gaussian distribution will (theoretically) explore every value of the search space (after infinite time). Fitness: Value of objective - penalties (if applicable)
EA EA Design Design Selection Initialization Representation Representation Evaluation Evaluation Fitness Population Size Variation Variation Crossover Mutation •All of these design decisions are interdependent. •Problem-specific knowledge must be taken into account.
“No No Free Free Lunch Lunch” Is there a set of problem- independent design decisions that performs above average? No ! Statistical (on average) all non-resampling search procedures perform identical to perfect random sampling. This is the main theorem of D.H. Wolpert and W.G. Macready in “No Free Lunch Theorems for Optimization”. IEEE Transactions on Evolutionary Computation, Vol. 1, No. 1, 1997. pp. 67-82 The same holds for the choice of representation. For a given representation, we can always find variation operators etc. that mimic any other choice. Positive consequence : we are free to choose any conceptually reasonable representation .
Common Common Representation Representation Types Types Fixed Fixed length length symbol symbol vector vector suitable for •choice problems (e.g. Knapsack) n1 n2 n3 n4 ... nm means: take n 1 units of item 1, n 2 units of item 2, ... •independent values in a real-valued functions (e.g. regression) f ( v means: approximation is n a1 a2 a3 a4 ... an x ) = a i x i ∑ i = 1
Common Representation Common Representation Types Types Permuations Permuations suitable for •TSP c1 c2 c3 c4 ... cn means: first visit city c1, then c2, then ... •scheduling tasks t1 t2 t3 t4 ... tn means: first perform task t1, then t2, then ...
Common Representation Common Representation Types Types c/1 a/0 State State Automata Automata b/0 a/1 b/1 1 a 0 1 1 b 1 3 1 c 1 2 is the transition table of the Mealy machine 2 a 1 3 3 b 0 2 obviously variational operators must be designed very carefully for this case
Common Common Representation Representation Types Types + Symbolic Symbolic Expressions Expressions (tree (tree structures) structures) * * f ( x , y ) = 2 ⋅ sin( x ) + 3 ⋅ cos( x ) 2 sin 3 cos x y Examples: •non-linear aproximations •control equations, •cluster borders •genetic programming
Common Common Variation Variation Operators Operators On On fixed-length fixed-length symbol symbol vectors vectors •mutation flipping (for binary strings) Gaussian perturbation (real valued strings) Adding/subtracting a random integer (integer valued strings) changing an element (for fixed alphabet choice) •crossover n -point crossover (cut at n-positions and shuffle substrings) arithmetic means a b c d e f g h a b c d g f e h a b c d a b c d e f g h g f e h 2 - point crossover
Common Common Variation Variation Operators Operators On On fixed-length fixed-length symbol symbol vectors vectors •mutation flipping (for binary strings) Gaussian perturbation (real valued strings) Adding/subtracting a random integer (integer valued strings) changing an element (for fixed alphabet choice) •crossover n -point crossover (cut at n-positions and shuffle substrings) arithmetic means x1 x2 x3 x4 ... xn z1 z2 z3 z4 ... zn y1 y2 y3 y4 ... yn z i = a ⋅ x i + (1 − a ) ⋅ y i , 0 ≤ a ≤ 1 arithmetic crossover
Recommend
More recommend