Recherche Op´erationnelle et Optimisation Master 1
S´ebastien Verel verel@univ-littoral.fr
http://www-lisic.univ-littoral.fr/~verel
Universit´e du Littoral Cˆote d’Opale Laboratoire LISIC Equipe CAMOME
Optimisation num´ erique
D´efinition : Probl`eme d’optimisation num´erique
Espace de recherche : ensemble de toutes les solutions possibles,
X ⊂IRn
Fonction objectif : crit`ere de cout (minimisation) f :IRn→IR
But : R´esoudre un probl`eme d’optimisation num´erique Trouver une des meilleures solution selon le crit`ere :
x? =argmin f
Mais, des fois, ensembles des meilleures solutions, bonne
approximation de la meilleure solution, bonne solution ’robuste’, etc.
Contexte Introduction strat´egie d’´evolution Strat´egie d’´evolution
M´ ethode de la descente du gradient
Algorithme de descente du gradient Choisir solution initialex ∈ X repeat
w ← −∇f(x)
Choisir un nombre r´eel σ >0 x ←x+σ w
until crit`ere d’arrˆet non verifi´e
Comment choisir le step size σ en fonction de f etx? Comment d´efinir le crit`ere d’arrˆet ?
M´ ethode de la descente du gradient
Algorithme de descente du gradient Choisir solution initialex ∈ X repeat
w ← −∇f(x)
Choisir un nombre r´eel σ >0 x ←x+σ w
until crit`ere d’arrˆet non verifi´e
Questions l´egitimes :
Comment choisir le step size σ en fonction de f etx? Comment d´efinir le crit`ere d’arrˆet ?
M´ ethode de Newton
Algorithme de Newton (dimension 1) Choisir solution initialex ∈ X repeat
w ← −1
f00(x)f0(x) x ←x+w
until crit`ere d’arrˆet non verifi´e
Algorithme de Newton (dimension n) Choisir solution initialex ∈ X repeat
w ← −[H(f(x))]−1∇f(x) x ←x+w
until crit`ere d’arrˆet non verifi´e
o`u H est la matrice Hersienne (matrice des d´eriv´ees secondes partielles)
Variantes des m´ ethodes de gradient
(Batch) gradient descent :
∇f(θ) =Ej∈1...p[∂f∂θ(θ;x(j),y(j))] ; θ←θ+σ ∇f(θ) Stochastic gradient descent :
∇f(θ;j) = ∂f∂θ(θ;x(j),y(j)) ;
∀j rnd order, θ ←θ+σ ∇f(θ;j) Momentum gradient descent : vt =γvt−1+σ∇f(θ) ; θ←θ−vt
Nesterov accelerated gradient descent (NAG) : vt =γvt−1+σ∇f(θ−γvt−1) ; θ←θ−vt Adagrad gradient descent :
gt,i =∇if(θ) ; Gt,ii =P
t06tgt20,i; ∀i, θi ←θi −√ σ
Gt,ii+gt,i
AdaDelta gradient descent : E[g2]t =γE[g2]t−1+ (1−γ)gt2; E[∆θ2]t =γE[∆θ2]t−1+ (1−γ)∆θ2t;
∆θt=−
√
E[∆θ2]t−1+
√
E[g2]t+ gt; θt←θt−1+ ∆θt
Variantes des m´ ethodes de gradient
Adam gradient descent :
mt =β1mt−1+ (1−β1)gt;vt =β2vt−1+ (1−β2)gt2; ˆ
mt =mt/(1−β1t) ; ˆvt =vt/(1−β2t) ;θt+1 =θt− √vσ
t+mˆt AdaMax gradient descent :
mt =β1mt−1+ (1−β1)gt;vt = max(β2vt−1,|gt|) ; ˆ
mt =mt/(1−β1t) ;θt+1=θt−vσ
tmˆt
Nadam gradient descent :
mt =β1mt−1+ (1−β1)gt;vt =β2vt−1+ (1−β2)gt2; ˆ
mt =mt/(1−β1t) ; ˆvt =vt/(1−β2t) ; θt+1 =θt−√vσ
t+(β1mˆt+ (1−β1−β1)gt t
1 )
Commentaires
Toutes ces m´ethodes utilisent la connaissance du gradient.
Ce n’est pas le cas dans le contexte d’optimisation boite noire, o`u l’on suppose le gradient inaccessible.
L’introduction de l’al´eatoire peut aider `a ”sortir” des points cols (saddle points).
Introduction aux strat´ egies d’´ evolution (evolution strategy)
Bibliographie :
Cours introductif de l’´ecole d’´et´e en ´evolution artificielle Anne Auger, juin 2012 :
https://sites.google.com/site/ecoleea2012/programme
Stochastic algorithms with unique solution (Local Search)
S set of solutions (search space) f :S →IRobjective function V(s) set of neighbor’s solutions of s
Recherche Locale (LS)
S ensemble des solutions (espace de recherche),
f :S →IRfonction objectif `a maximiser (ou coˆut `a minimiser) V(s) ensemble des solutions voisines des
Algorithme d’une Recherche Locale Choisir solution initiales ∈ S
repeat
choisirs0 ∈ V(s) if accept(s,s0)then
s ←s0 end if
until crit`ere d’arrˆet non verifi´e
Hill-Climber (HC)
Heuristique d’exploitation maximale.
Hill Climber (best-improvement) Choisir solution initiales ∈ S repeat
Choisirs0 ∈ V(s) telle que f(s0) est minimale
s ←s0
until s optimum local
Algorithme de comparaison Op´erateur local de base de
m´etaheuristique
Optimum local / global
Optimum local
Etant donn´e (S,f,V),f `a minimiser.
x? est un optimum local ssi pour toutx ∈ V(x?),f(x?)6f(x)
Optimum local strict
Etant donn´e (S,f,V),f `a minimiser
x? est un optimum local ssi pour toutx ∈ V(x?),f(x?)<f(x)
Optimum global
Etant donn´e (S,f,V),f `a minimiser.
x? est un optimum global ssi pour toutx ∈ S,f(x?)6f(x)
Hill-Climbing first-improvement
Hill-climber First-improvement (minimizer) Choisir solution initiales ∈ S
repeat
Choisirs0 ∈ V(s) al´eatoirement if f(s0)≤f(s)then
s ←s0 end if
until s optimum local OU nbr d’´eval. ≤maxNbEval
Contexte Introduction strat´egie d’´evolution Strat´egie d’´evolution
Evolution Strategy
Comment adapter au cas continue les algorithmes hill-climbers qui n’utilisent pas le gradient ?
Evolution Strategy
Comment adapter au cas continue les algorithmes hill-climbers qui n’utilisent pas le gradient ?
Rappel : loi normale, TP09
(1 + 1)-Evolution Strategy (basic version)
Dans cet algorithme, (1 + 1)-ES, le step sizeσ est constant, et le voisinage/d´eplacement est identique selon toutes les coordonn´ees.
Version basique de l’algorithme (1 + 1)-Evolution Strategy Choose initial meanm∈IRn
repeat
x0 ←m+σ Nn(0,1)
if f(x0) is better than f(m) then m←x0
end if
until crit`ere d’arrˆet non verifi´e
σ∈IR (step size)
Nn(0,1) est la loi normale centr´ee r´eduite de dimensionn.
(1 + 1)-Evolution Strategy
(1 + 1)-ES
Choose randomly initial meanm∈IRn repeat
x0 ←m+σ Nn(0,C) =Nn(m, σ.C) if f(x0) is better than f(m) then
m←x0 end if
until crit`ere d’arrˆet non verifi´e
σ∈IR (step size) et la matriceC ∈IRn×n (covariance matrix) sont des param`etres de l’algorithme.
(1 + 1)-Evolution Strategy with One-fifth success rule
(1 + 1)-Evolution Strategy with 1/5 rule Choose randomly initial solutionm∈IRn repeat
x0 ←m+σ N(0,C) if x0 is better thanm then
m←x0
σ←σ×exp(1/3) else
σ←σ/exp(1/3)1/4 end if
until crit`ere d’arrˆet non verifi´e
La matriceC ∈IRn×n (covariance matrix) est un param`etre de l’algorithme.
(1 + 1)-Evolution Strategy with path length control
(1 + 1)-Evolution Strategy with path length control Choose randomly initial solutionm∈IRn
p ←0n repeat
x0 ←m+σ N(0,C) if x0 is better thanm then
y←x0 −m
p←(1−cσ)∗p+p
1−(1−cσ)2∗y m←x0
else
p←(1−cσ)∗p end if
σ ←σ×exp(cdσ
σ ∗(E[N||p||(0,1)]2 −1)) until crit`ere d’arrˆet non verifi´e
avecE[N(0,1)] = 0.8,cσ = 0.1,dσ = 1.
(µ/µ, λ)-Evolution Strategy
(µ/µ, λ)-ES
Choose randomly initial meanm∈IRn repeat
for i ∈ {1. . . λ} do xi0 ←m+σ N(0,C) Evaluatexi0 with f end for
Select the µbest solutions from{x10, . . . ,xλ0}
Let bex:j those solutions ranking by increasing order of f : f(x:1)≤. . .≤f(x:µ)
m←Pµ j=1wjx:j0
until crit`ere d’arrˆet non verifi´e
avec ˆwi = log(µ+ 0.5)−log(i) et wi = ˆwi/Pµ i=1wˆi