Lecture 3 Evolutionary Algorithms

Lecture 3
Evolutionary Algorithms
Invited Guest Professorship
Université Lois Pasteur, Strasbourg
Prof. Dr. Gisbert Schneider
Goethe-University, Frankfurt
25 November 2008, (c) G. Schneider
Optimization Tasks
Adaptive Walk
in a “fitness landscape”
Start
Xn
End
Fitness
Global optimum
Local optimum
X2
X1
X1
X2
2
Fitness
Types of fitness landscapes
The Dream
The Nightmare
3
Local Neighborhood Search
Start
B
q
A
C
Neighborhood N
x
Local
optimum
• fixed N
• variable (“adaptive”) N
4
Local Neighborbood Strategies
Local (neighborhood) search
Any-ascent/Stochastic
hill-climbing
Simulated
annealing
Steepest/First-ascent
hill-climbing
Threshold-accepting
Population-based
Genetic
algorithms
Evolution
strategies
Evolutionary
programming
Tabu search
5
Elements of artificial adaptive systems (Koza)
•
Structures that undergo adaptation
•
Initial structures (starting solutions)
•
Fitness measure that evaluates the structures
•
Operations to modify the structures
•
State (memory) of the system at each stage
•
Method for designating a result
•
Method for terminating the process
•
Parameters that control the proces
6
Learning from Nature ...
• Genetic algorithms
• Evolution strategies
• Particle Swarm Optimization (PSO)
• Ant Colony Optimization (ACO)
7
Which search strategy should be applied?
Global & local search techniques guided by
• Random parameter variation
• Stepwise systematic parameter variation
• Gradients in the fitness landscape ...
There is no one best method.
Evolutionary algorithms are
• easily implemented
• robust
• able to cope with high-dimensional optimization tasks
8
Searching in real and artificial fitness landscapes
Quality
(experimental)
“Fitness”
(calculated)
Idealized path
Neural network model
of peptide antibody recognition
9
n
xi2
x 
f ( x) = ∑
− ∏ cos i  + 1
i =1 4000
i =1
 i
n
n
(
f ( x) = 10 ⋅ n + ∑ xi2 − 10 ⋅ cos(2 ⋅ π ⋅ xi )
)
i =1
a) Griewangk Funktion
b) Rastrigin Funktion
c) De Jong‘s Sphere Funktion
n
f ( x) = ∑ xi2
i =1
globales Minimum
globales Minimum
d) Schaffer F6 Funktion
e) Rosenbrock Funktion
globales Minimum
f ( x) = 0.5 +
sin 2 x 2 + y 2 − 0.5
(1 + 0.001 ⋅ ( x
2
+ y2 )
n −1
)
2
(
f ( x) = ∑100 ⋅ xi +1 − x
2
) + (1 − x )
2 2
i
i
i =1
10
Operators of Evolutionary Optimization
Variation
• Mutation
Adds new information to a population
• Crossover
Exploits information within a population
• Selection
11
Genetic Algorithms: Chromosome Representation
O
S
O
NH
H
N
Descriptors
Real Binary Gray
clogP
cMW
O+N
H-donors
Surfpolar [Å2]
5.19
404
5
2
59.9
100
011
100
001
010
110
010
110
001
011
O
100011100001010
110010110001011
genes
chromosome
12
Principle of Evolutionary Searching
Step 1: Random search
Step 2 and following:
“Local hill climbing”
Optimum
Best value
Generate a diverse set of parameter
values and hope for a hit
Generate localized distributions
of parameter values
and improve steadily
Adaptive neighborhood
13
The (µ,λ
λ) Evolution Strategy
(Rechenberg, 1973)
14
Algorithm of the (1,λ
λ) Evolution Strategy
Stepsize
Variables
Quality (“Fitness”)
Initialize parent (ξ
ξP,σ
σP,QP);
For each generation:
Generate λ variants (ξ
ξV,σ
σV,QV) around the parent:
σV = abs(σ
σP + G);
ξV = ξP + σV
•
G;
calculate fitness QV;
Select best variant by QV ;
Set (ξ
ξP,σ
σP,QP) ≡ (ξ
ξV,σ
σV,QV)best ;
Box-Muller:
G(i , j ) = − 2 ln(i ) ⋅ sin(2π j )
i,j: pseudo-random numbers in ]0,1]
in [-∞,∞]
15
Evolutionary Optimization: Protein backbone folding
Variables: Coordinates of “Beads on a string”
Fitness function: Empirical potential
„Folding“ of the ribonucleasese A backbone
X-ray structure (1rtb)
16
Multiobjective Optimization (MO)
One possibility: weighted Fitness Function
f(property) = w1 * property1 + w2 * property2 + …
Disadvantages:
• The setting of the weights is non-intuitive
• Regions of the search space may be excluded due to
the chosen weight setting
• Objectives may be correlated
• Only a single solution is found
17
MOGA – Multiobjective Genetic Algorithm
• Most optimization algorithms can only cope with a single
objective
• Evolutionary Algorithms use a population of solutions
MOGA (Fonseca and Fleming 1993):
• Maps out the hypersurface in the search space where all
solutions are tradeoffs between the different objectives
• Searches for a set of non-dominated solutions
• The ranking of solutions is based on dominance instead
of a fitness function (Pareto ranking)
18
Multiobjective Optimization (MO)
• Many practical optimization applications are
characterized by more than one objective
• Optimal performance in one objective often correlates
with low performance in another one
• Strong need for a compromise
• Search for solutions that offer acceptable performance
in all objectives
19
MOGA – Multiobjective Genetic Algorithm
Potential solutions in a two-objective (f1 and f2) minimization problem:
f2
0
2
4
0
number of times the
solution is dominated
0
1
0
dominated solution
0
non-dominated solution
(Pareto solution)
f1
20
Particle Swarm Optimization (PSO)
• Biological motivated optimization paradigm
• Individuals move through a fitness landscape
• Particles can change their movement direction and velocities
• “Social” interactions between individuals of a population
• Each particle knows about its own best position and all
particles know about the overall best position
21
Particle Swarm Optimization (PSO) – cont.
22
T. Krink, University of Aarhus
PSO Algorithm
begin
initialize particle Positions and Memories
evaluate Fitness
while (stop criterion ≠ true)
compute new Particle Velocities
compute new Particle Positions
evaluate Fitness
update Memories
end
end
23
PSO: Update Rule 1 (Standard Type)
Individual
Memory
Social
Memory
v i (t + 1) = v i (t ) + 2 ⋅ r1 ⋅ ( p i − xi (t )) + 2 ⋅ r2 ⋅ ( p b − x i (t ))
v:
x:
i:
t:
r1 and r2:
pi and pb:
Velocity vector of a particle
Position of a particle
Dimension
Epoch (“time”)
pseudo-random numbers between 0 and 1
best Positions stored in the individual and social Memories
24
PSO: Update Rule 2 (Inertia Weight Type)
Inertia
Weight
Individual
Memory
Social
Memory
v i (t + 1) = w ⋅ v i (t ) + n1 ⋅ r1 ⋅ ( p i − x i (t )) + n 2 ⋅ r2 ⋅ ( p b − x i (t ))
v:
x:
w:
i:
t:
n1 and n2:
r1 and r2:
pi and pb:
Velocity vector of a particle
wstart − wend
w
=
w
−
⋅ Epochs
start
Position of a particle
MaxEpochs
inertia weight
Dimension
Epoch (“time”)
constants for the individual and social terms
pseudo-random numbers between 0 and 1
best Positions stored in the individual and social Memories
25
PSO: Individual and Social Memory
Convergence of PSO for the minimization of the
Griewangk-Function after 100 epochs
global
minimum
n1 = 1
n2 = 2
n1 = 2
n2 = 1
Higher weight on the
social memory
26
PSO: Update Rule 3 (Constriction Type)
Constriction
Constant
Individual
Memory
Social
Memory
v i (t + 1) = K ⋅ ( v i (t ) + n1 ⋅ r2 ⋅ ( pi − xi (t )) + n2 ⋅ r2 ⋅ ( pb − xi (t )))
v:
x:
K:
i:
t:
n1 and n2:
r1 and r2:
pi and pb:
Velocity vector of a particle
2
K
=
Position of a particle
| 2 − ϕ − ϕ 2 − 4ϕ |
constriction constant
ϕ = n1 + n 2 , ϕ > 4
Dimension
Epoch (“time”)
constants for the individual and social terms
pseudo-random numbers between 0 and 1
best Positions stored in the individual and social Memories
27
The Constriction constant regulates swarm behavior in two ways
(Kennedy & Eberhart, 2001):
• It leads to swarm convergence after a certain period of time.
• If the swarm has found a local optimum, the value of K determines its
ability to escape the local optimum.
Global
minimum
Global
minimum
Rosenbrock function
Constriction-Type
Standard-Type
(after 100 epochs)
28
Particle Trajectories
Global
minimum
• The particle visited several local optima bevor the global
optimum was found
29
Exercise
1) Go to the modlab website: www.modlab.de software PSOViz
• make yourself familiar with the PSOViz software options
2) Start PsoViz from your local computer (or directly from the website)
Choose a fitness function and change the various PSO parameter settings.
• Do you see an influence on the convergence behavior?
• How do you explain the differences?
• Do you observe „typical problems“ with PSO?
30