Evolutionary Computation Chao Lan
Outline Introduction Genetic Algorithm Evolutionary Strategy Genetic Programming
Introduction Evolutionary strategy can jointly optimize multiple variables. - e.g., max f(x 1, x 2,..., x n ) with respect to x 1, x 2,..., x n. - variables can be continuous - applies mutation but not necessarily crossover
(1+1) ES Algorithm (1+1) is the simplest ES algorithm.
(1+1) ES Algorithm (1+1) is the simplest ES algorithm. - one parent generates one offspring per iteration
(1+1) ES Algorithm (1+1) is the simplest ES algorithm. - one parent generates one offspring per iteration - apply Gaussian mutation on every element x i = x i + N(0, σ)
(1+1) ES Algorithm (1+1) is the simplest ES algorithm. - one parent generates one offspring per iteration - apply Gaussian mutation on every element x i = x i + N(0, σ) - intuition: mutation is more likely to be small - σ is called global step size
(1+1) ES Algorithm (1+1) is the simplest ES algorithm. - one parent generates one offspring per iteration - apply Gaussian mutation on every element x i = x i + N(0, σ) - intuition: mutation is more likely to be small - σ is called global step size - σ can be adaptive by the 1/5-rule
The 1/5-Rule In x i = x i + N(0, σ), σ can be adaptive by the 1/5-rule. Let p s be the probability of mutation success (estimated after k interactions), let c [0.8,1], the 1/5-rule says - if p s > 1/5, then σ = σ / c - if p s < 1/5, then σ = σ * c - if p s = 1/5, then σ = σ There are, of course, more sophisticated methods to update p m.
The 1/5-Rule In x i = x i + N(0, σ), σ can be adaptive by the 1/5-rule. Let p s be the probability of mutation success (estimated after k interactions), let c [0.8,1], the 1/5-rule says - if p s > 1/5, then σ = σ / c - if p s < 1/5, then σ = σ * c - if p s = 1/5, then σ = σ Q: what is the rationale of this design?
The 1/5-Rule In x i = x i + N(0, σ), σ can be adaptive by the 1/5-rule. Let p s be the probability of mutation success (estimated after k interactions), let c [0.8,1], the 1/5-rule says - if p s > 1/5, then σ = σ / c - if p s < 1/5, then σ = σ * c - if p s = 1/5, then σ = σ Q: what is the rationale of this design? Q: when should we update p s?
More General ES Algorithm Start with multiple parents in population. Parents are selected for recombination. Recombined solutions are mutated. More fitted solutions survive.
Recombination To generate offspring (z 1, z 2,, z n ) from parents (x 1, x 2,, x n ) and (y 1, y 2,, y n ). 1. Local Intermediary: fix parents and get z i = ( x i + y i ) / 2
Recombination To generate offspring (z 1, z 2,, z n ) from parents (x 1, x 2,, x n ) and (y 1, y 2,, y n ). 1. Local Intermediary: fix parents and get z i = ( x i + y i ) / 2 2. Global Intermediary: for each i, pick up two parents and get z i = ( x i + y i ) / 2
Recombination To generate offspring (z 1, z 2,, z n ) from parents (x 1, x 2,, x n ) and (y 1, y 2,, y n ). 1. Local Intermediary: fix parents and get z i = ( x i + y i ) / 2 2. Global Intermediary: for each i, pick up two parents and get z i = ( x i + y i ) / 2 3. Local Discrete: fix parents and get z i = x i or y i (randomly)
Recombination To generate offspring (z 1, z 2,, z n ) from parents (x 1, x 2,, x n ) and (y 1, y 2,, y n ). 1. Local Intermediary: fix parents and get z i = ( x i + y i ) / 2 2. Global Intermediary: for each i, pick up two parents and get z i = ( x i + y i ) / 2 3. Local Discrete: fix parents and get z i = x i or y i 4. Global Discrete: for each i, pick up two parents and get z i = x i or y i (randomly)
Back to (1+1) Q: how can we add recombination in (1+1)?
Outline Introduction Genetic Algorithm Evolutionary Strategy Genetic Programming
Introduction Genetic programming evolves computer program. It is based on the fact that any computer program is a sequence of operations applied to values. Different programming languages may include different types of statements and operations, and have different syntactic restrictions. We will focus on LISP. An operation is also called a function; a value is also called an argument.
LISP List Processor is one of the oldest high-level programming languages used in AI. - great for symbolic AI Its basic data structures are atoms and lists. - atom is the smallest indivisible element - list is an object composed of atoms and/or other lists
LISP List Processor is one of the oldest high-level programming languages used in AI. - great for symbolic AI Its basic data structures are atoms and lists. - atom is the smallest indivisible element - list is an object composed of atoms and/or other lists (- (*AB) C) which is operation (A*B)-C
LISP List Processor is one of the oldest high-level programming languages used in AI. - great for symbolic AI Its basic data structures are atoms and lists. - atom is the smallest indivisible element - list is an object composed of atoms and/or other lists (- (*AB) C) which is operation (A*B)-C Q: what are the atoms, what are the lists?
LISP List Processor is one of the oldest high-level programming languages used in AI. - great for symbolic AI Its basic data structures are atoms and lists. - atom is the smallest indivisible element - list is an object composed of atoms and/or other lists (- (*AB) C) which is operation (A*B)-C - both atoms and lists are symbolic expressions or S-expression
Tree Representation of S-Expression Any S-expression can be represented as a tree.
Tree Representation of S-Expression Any S-expression can be represented as a tree. function terminal
Tree Representation of S-Expression Any S-expression can be represented as a tree. function we can evolve the tree to generate new expression! terminal
Example: Pythagorean Theorem We want to find an S-expression that represents the Pythagorean Theorem.
Basically, we want to evolve the tree...
Q: How to design fitness function?
Fitness Function fitness = absolute difference between two formulas over multiple fitness cases Values of a, b are chosen randomly over a broad range.
Q: How to design crossover?
Crossover
Crossover
Q: Will this crossover work?
Q: How to design mutation?
Mutation: Example 1
Mutation: Example 1
Q: Will these mutations work? * sqrt
Will these mutations work? a +
The GP Algorithm GP is similar to GA except 1. best-so-far always survives 2. cloning/crossover/mutation
Simulation Result Population size is 500.
Remarks GP is great for symbolic AI problem. No need to design chromosome as GA. Not provably scalable to complex problems.