ce 191: civil and environmental engineering systems analysis - barrier penalty fcn.pdfbarrier...
TRANSCRIPT
CE 191: Civil and Environmental EngineeringSystems Analysis
LEC 12 : Barrier & Penalty Functions
Professor Scott MouraCivil & Environmental EngineeringUniversity of California, Berkeley
Fall 2014
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 1
Gradient Descent
Does not explicitly account for constraints.
Barrier and penalty functions approximate constraints by augmentingobjective function f(x)
Consider constrained minimization problem
minx
f(x),
s. to g(x) ≤ 0
converted tominx
f(x) + φ(x; ε)
where φ(x; ε) captures the effect of constraints & is differentiable, thusenabling gradient descent
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 2
Two Methods for φ(x; ε): Barrier & Penalty Functions
Barrier Function: Allow the objective function to increase towardsinfinity as x approaches the constraint boundary from inside thefeasible set. In this case, the constraints are guaranteed to be satisfied,but it is impossible to obtain a boundary optimum.
Penalty Function: Allow the objective function to increase towardsinfinity as x violates the constraints g(x). In this case, the constraintscan be violated, but it allows boundary optimum.
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 3
Constrained vs. Unconstrained Optimization
Example: find the optimum of the following function within the range[0,+∞)
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 4
Constrained vs. Unconstrained Optimization
Example: find the optimum of the following function within the range[0.5,1.5]
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 5
Main idea of barrier methods
Add a barrier function which is infinite outside of the constraint domain, i.e.[a,b]
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 6
Main idea of barrier methods
In practice, such continuous and smooth functions do not exist, so they haveto be approximated
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 7
Logarithmic Barrier Function
b(x) = −ε log((x− a)(b− x)), ε = 1
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 8
Logarithmic Barrier Function
b(x) = −ε log((x− a)(b− x)), ε = 1/2
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 9
Logarithmic Barrier Function
b(x) = −ε log((x− a)(b− x)), ε = 1/4
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 10
Logarithmic Barrier Function
b(x) = −ε log((x− a)(b− x)), ε = 1/8
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 11
Logarithmic Barrier Function
b(x) = −ε log((x− a)(b− x)), ε = 1/16
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 12
Logarithmic Barrier Function
b(x) = −ε log((x− a)(b− x)), ε = 1/32
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 13
Utilization of Barrier Function
Add the barrier function b(x) to the objective function f(x)1 inside the constraint set, barrier ≈ 02 outside the constraint set, barrier is infinite
If the barrier is almost zero inside the constraint set, the minimum of thefunction and the augmented function are almost the same.
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 14
Illustration of the convergence of the log barrier
Logarithmic barrier: ε = 1
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 15
Illustration of the convergence of the log barrier
Logarithmic barrier: ε = 1/2
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 16
Illustration of the convergence of the log barrier
Logarithmic barrier: ε = 1/4
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 17
Illustration of the convergence of the log barrier
Logarithmic barrier: ε = 1/8
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 18
Illustration of the convergence of the log barrier
Logarithmic barrier: ε = 1/16
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 19
Illustration of the convergence of the log barrier
Logarithmic barrier: ε = 1/32
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 20
Illustration of the convergence of the log barrier
Make a guess inside the constraint set.
Start with epsilon not too small.
repeat
minimize the augmented function (using e.g. gradient descent)
use the result as the guess for the next step
decrease the log barrier
Until barrier is almost zero inside the constraint set
One can prove that the result of this method converges to a minimum of theoriginal problem
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 21
Illustration of the convergence of the log barrier
Logarithmic barrier: ε = 1
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 22
Illustration of the convergence of the log barrier
Logarithmic barrier: ε = 1/2
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 23
Illustration of the convergence of the log barrier
Logarithmic barrier: ε = 1/4
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 24
Illustration of the convergence of the log barrier
Logarithmic barrier: ε = 1/8
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 25
Illustration of the convergence of the log barrier
Logarithmic barrier: ε = 1/16
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 26
Illustration of the convergence of the log barrier
Logarithmic barrier: ε = 1/32
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 27
Formal description of the algorithm
Start with epsilon not too small
repeat: solve
minx
f(x)− εb(x)
s. to no constriants
use the result as the guess for the next step
decrease the log barrier ε = ε = 2, or similar
Until barrier is almost zero inside the constraint set
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 28
Generalization to multiple dimensions
Transformation of a constrained problem into an unconstrained problem
minx
f(x),
s. to g(x) ≤ 0
Introduce log barrier function
b(x) = log(−g(x)) (1)
Problem to solve becomes (in the limit ε goes to zero):
minx
f(x)− εb(x)
s. to no constraints
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 29
Penalty Function Method
Transformation of a constrained problem into an unconstrained problem
minx
f(x),
s. to g(x) ≤ 0
Introduce quadratic penalty function
φ(x; ε) =
{0 if g(x) ≤ 012ε (x− g(x))2 otherwise
(2)
Problem to solve becomes (in the limit ε goes to zero):
minx
f(x) + φ(x; ε)
s. to no constraints
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 30
Additional Reading
Prof. Moura | UC Berkeley CE 191 | LEC 12 - Barrier & Penalty Fcns Slide 31