Professional Documents
Culture Documents
Evolutionary Search
Numerical
Optimization
Robert Stengel
Robotics and Intelligent Systems MAE 345,
Princeton University, 2011
Grid-based search
Random search
Downhill simplex method
Copyright 2011 by Robert Stengel. All rights reserved. For educational use only.
http://www.princeton.edu/~stengel/MAE345.html
Two Approaches to
Numerical Minimization
!J
" !J %
$# '& =
!u o !u
such that
u= un
J o = J ( u o ) = starting guess
J 2 = J1 + !J 2 ( u1 + !u 2 ) such that
J1 < J o
J 2 < J1
$#J
u k +1 = u k ! " &
&% # u
!J
!J
<
! u n ! u n (1
Newton Raphson
Steepest Descent
= starting guess
u= u0
!J
" !J %
" !J %
" !J %
=
+ )$ ' =
#$ ! u &' n $# ! u &' n (1
# !u & n !u
Gradient Search
Issues
'
)
u= u k )
(
#"2J
u k +1 = u k ! % 2
%$ " u
&
(
u= u k (
'
!1
#"J
%
%$ " u
&
(
u= u k (
'
Gradient-Free Search:
Grid-Based Search
Gradient-Free Search:
Random Search
J o = J ( u o ) = starting guess
J o = J ( u o ) = starting guess
J 2 = J1 + !J 2 ( u1 + !u 2 ) such that
J1 < J o
J 2 = J1 + !J 2 ( u1 + !u 2 ) such that
J 2 < J1
J1 < J o
J 2 < J1
Three-Parameter Random
Field Search
n = 1000
n = 125
Regular spacing
Fixed resolution
Trials grow as mn, where
n = Number of parameters
m = Resolution
n = 1000
Humanoid Walker
http://www.youtube.com/watch?v=BcYPLR_j5dg
[X,Y] = meshgrid(-8:.5:8);
Z = X.^2 + Y.^2;
Z1 = Z + 4*randn(33);
surf(X,Y,Z1)
colormap hsv
alpha(.4)
[X,Y] = meshgrid(-8:.5:8);
Z = X.^2 + Y.^2;
Z1 = Z + 4*randn(33);
surf(X,Y,Z1)
colormap hsv
alpha(.4)
Effect of Increasing
Noise on Cost Function
!z = 0
!z = 8
!z = 4
! z = 16
!z = 8
!z = 4
! z = 16
Effect of Averaging on
Noisy Cost Function
One trial
Estimating the
Probability of Coin Flips
!z = 0
One trial ! z = 16
[X,Y] = meshgrid(-8:.5:8);
Z = X.^2 + Y.^2;
Z1 = Z + 16*randn(33);
Z2 = Z1;
% Averaged Z1
for k = 1:1000
Z1 = Z + 16*randn(33);
Z2 = Z1 * (1/(k + 1)) + Z2 * (k/(k+1));
end
figure
surf(X,Y,Z2)
colormap hsv
alpha(.4)
1,000 trials ! z = 16
Single coin
21 coins
Exhaustive search: Correct answer in
nm = 221 = 2,097,152 trials
Random search (20,000 trials)
...
Single coin
21 coins
% Single coin
x
= [];
prob = round(rand);
for k = 1:20000
prob = round(rand) * (1/(k + 1)) + prob * (k/(k+1));
x
= [x prob];
end
figure
plot(x), grid
% 21 coins
y
= [];
prob = round(rand);
for k = 1:20000
for j = 1:21
coin(j) = round(rand);
end
score = sum(coin);
if score > 10
result = 1;
else result = 0;
end
prob = result * (1/(k + 1)) + prob * (k/(k+1));
y
= [y prob];
end
figure
plot(y), grid
Physical Annealing
Turbine Blade
Casting
Single-Crystal
Turbine Blade
Application of Annealing
Principle to Search
Pr(E) ! e
T : Temperature
Combination of Simulated
Annealing with Downhill
Simplex Method
e! ( J ! J ) / kT
2
SA Mona Lisa
http://www.youtube.com/watch?v=eHWZcPLRMjQ
e! ( J2 ! J1 ) / kT
" E / kT
k : Boltzmann's constant
J 2SA = J 2 + !J 2 ( rng )
J 3SA = J 3 + !J 3 ( rng )
... = ...
SA Face Morphing
http://www.youtube.com/watch?v=SP3nQKnzexs
Genetic Coding,
Recombination,
and Mutation
Progression of a
Genetic Algorithm
Broad Characteristics
of Genetic Algorithms
J1
J2
J3
J4
J total = ! J n
Bigger is better
n=1
Genetic Algorithm:
Reproduction
Reproduction Eliminates
Least Fit Chromosomes
Probabilistically
Starting Set
Starting Set
Pr(cn) = Jn /Jtotal
Multiple copies of most-fit chromosomes
No copies of least-fit chromosomes
Reproduced Set
Reproduced Set
Crossover Set
Reproduced Set
Tail
Head
Head
Tail
Crossover Set
Mutated Set
Comments
GA Mona Lisa
http://www.youtube.com/watch?v=rGt3iMAJVT8
GA Mona Lisa, 2
http://www.youtube.com/watch?v=A8x4Lyj33Ro&NR=1
Evolution of Locomotion
http://www.youtube.com/watch?v=STkfUZtR-Vs&feature=related
Parameter Uncertainties
and Touchdown
Requirements for ALFLEX
Reentry Test Vehicle
Particle Swarm
Optimization
Particle Swarm
Optimization
Jargon : argminJ(u) = u *
i.e., argument of J that minimizes J
u: Parameter vector ! "Position" of the particles
v: "Velocity" of u
dim(u) = dim(v) = Number of particles
Recursive algorithm to
find best particle or
configuration of particles
u k = u k !1 + av k !1
) (
) (
Particle Swarm
Optimization
Examples of Particle
Swarm Optimization
Comparison of Algorithms in
Caterpillar Gait-Training Example
Comparison of Phased-Array
Antenna Designs
Summary of Gradient-Free
Optimization Algorithms
!
Grid search
Random Search
Simulated Annealing
Genetic Algorithm
Next Time:
Formal Logic and
Turing Machines