Docsity

Practical Newton Methods: Inexact Newton Steps and Line Search Newton-CG Method - Prof. P., Study notes of Mathematics

Toggle sidebar
bg1
Numerical Optimization
Lecture Notes #13 — Practical Newton Methods
Inexact Newton Steps / Linesearch Newton Methods
Peter Blomgren,
Department of Mathematics and Statistics
Dynamical Systems Group
Computational Sciences Research Center
San Diego State University
San Diego, CA 92182-7720
http://terminus.sdsu.edu/
Fall 2009
Peter Blomgren, h[email protected]iPractical Newton Methods — (1/18)
Outline
1Recap
Nonlinear Conjugate Gradient Methods
2Practical Newton Methods
Introduction
Newton-CG — “Inexact Newton Methods”
3Line Search Newton-CG Method
Dealing with Negative Curvature
4Modified Newton’s Method
Peter Blomgren, h[email protected]iPractical Newton Methods — (2/18)
Recap Nonlinear Conjugate Gradient Methods
Quick Recap: Nonlinear Conjugate Gradient Methods
Extension of the linear CG to work for non-linear (optimization) problems.
In the first pass (Fletcher-Reeves’ Algorithm), we simply replaced all
instances of the residual ˜rkby the gradient of the objective ∇f(˜xk), and
the step length αkis calculated by a linesearch.
We looked at some modifications, and arrived at the Polak-Ribi`ere PR+CG
algorithm, where the βof Fletcher-Reeves is modified
βFR
k+1 =∇fT
k+1∇fk+1
∇fT
k∇fk
→βPR
k+1=∇fT
k+1(∇fk+1− ∇fk)
∇fT
k∇fk
and the final βis β+
k+1 =max(βPR
k+1,0).
Finally, periodic restarting, when
∇fT
k∇fk−1
∇fT
k∇fk
≥ν∼0.1
was introduced in order to get good convergence.
Peter Blomgren, h[email protected]iPractical Newton Methods — (3/18)
Practical Newton Methods
Line Search Newton-CG Method
Modified Newton’s Method
Introduction
Newton-CG — “Inexact Newton Methods”
Practical Newton Methods: Introduction
We know (e.g. from Lecture #5) that Newton’s method has great
local convergence properties. Once we get close to the minimizer
˜x∗convergence is quadratic.
This convergence requires that we start “close enough” to ˜x∗— in
regions far away, where the objective is not convex, all bets are off
and the behavior can be quite erratic; we cannot guarantee
convergence at all!
Our present goal:
— To design a Newton-based method which is robust and efficient
in “all” cases.
Peter Blomgren, h[email protected]iPractical Newton Methods — (4/18)
pf3
pf4
pf5

Partial preview of the text

Download Practical Newton Methods: Inexact Newton Steps and Line Search Newton-CG Method - Prof. P. and more Study notes Mathematics in PDF only on Docsity!

Numerical Optimization Lecture Notes #13 — Practical Newton MethodsInexact Newton Steps / Linesearch Newton Methods^ Peter Blomgren, 〈[email protected]

Department of Mathematics and Statistics^ Dynamical Systems GroupComputational Sciences Research Center^ San Diego State UniversitySan Diego, CA 92182-7720^ http://terminus.sdsu.edu/^ Fall 2009 Peter Blomgren, 〈[email protected]〉^ Practical Newton Methods

— (1/18)

Outline^1 Recap^ Nonlinear Conjugate Gradient Methods^2 Practical Newton Methods^ Introduction^ Newton-CG — “Inexact Newton Methods”^3 Line Search Newton-CG Method^ Dealing with Negative Curvature^4 Modified Newton’s Method^ Peter Blomgren,^ 〈[email protected]

〉^ Practical Newton Methods^

— (2/18)

Recap^ Nonlinear Conjugate Gradient Methods Quick Recap: Nonlinear Conjugate Gradient Methods^ Extension of the linear CG to work for non-linear (optimization) problems.In the first pass (Fletcher-Reeves’ Algorithm), we simply replaced allinstances of the residual

˜rby the gradient of the objectivek^

∇f^ (˜x), andk^ the step length^ αis calculated by a linesearch.k^ We looked at some modifications, and arrived at the Polak-Ribi`

ere^ PR+CG algorithm, where the^ β^ of Fletcher-Reeves is modifiedT∇f^ ∇fFRk+1^ β=^ k+^

T∇fk+1PRk+ → β= (^) k+ (^1) T ∇f ∇fkk (∇f− ∇f)k+^1 k 1 T^ ∇f∇fkk^

  • and the final β is β= k+^ PR max(β,^ 0). k+ Finally, periodic restarting, when

T ∇f ∇fk−^1 k^ ≥^ ν^ ∼^0.^1 T ∇f^ ∇fkk^ was introduced in order to get good convergence.^ Peter Blomgren,^ 〈[email protected]

〉^ Practical Newton Methods^

— (3/18)

Practical Newton Methods^ IntroductionLine Search Newton-CG MethodNewton-CG — “Inexact Newton Methods”Modified Newton’s Method Practical Newton Methods: Introduction We know (e.g. from Lecture #5) that Newton’s method has greatlocal convergence properties. Once we get close to the minimizer∗ (^) ˜xconvergence is^ quadratic. This convergence requires that we start “close enough” to

∗^ ˜x— in regions far away, where the objective is not convex, all bets are offand the behavior can be quite erratic; we cannot guaranteeconvergence at all! Our present goal: —^ To design a Newton-based method which is robust and efficientin “all” cases.^ Peter Blomgren,^ 〈[email protected]

〉^ Practical Newton Methods^

— (4/18)

Practical Newton Methods^ IntroductionLine Search Newton-CG MethodNewton-CG — “Inexact Newton Methods”Modified Newton’s Method The Newton Step We get the Newton step from the symmetric

n^ ×^ n^ linear system The Newton Direction:

2 N ∇f^ (˜x)˜p=^ −∇k^ k^ f^ (˜x)k^ For^ global convergence

the Newton direction must be a

descent direction, this is true if the Hessian (

(^2) ∇f^ (˜x)) is^ positivek^ definite. If the Hessian is not positive definite, the Newton direction may bean^ ascent direction^ and/or extremely long (division by almostzero).We look at two approaches: The first uses the conjugate gradientmethod, and gives us the

“Newton-CG”^ methods for both line-search and trust-region methods; the second strategy involvesmodifying the Hessian so that it becomes

“sufficiently positive definite,”^ yielding the^ “modified Newton method.” Peter Blomgren, 〈[email protected]〉^ Practical Newton Methods

— (5/18)

Practical Newton Methods^ IntroductionLine Search Newton-CG MethodNewton-CG — “Inexact Newton Methods”Modified Newton’s Method Computational Cost As always, we want to keep the computational cost down.In Newton-CG, this is accomplished by terminating thecomputation before an exact solution to^2 N^ ∇f^ (˜x)˜p=^ −∇k^ k^

f^ (˜x)k^ has been found. Thus we get and

approximation ˜p≈^ k^

N˜p, hencek^ the name^ “inexact Newton methods.” We would like to exploit any special

sparsity structure^ in the Hessian in order to solve the linear problem as efficiently aspossible.For now, we assume we

have^ access to the Hessian in

analytical form. We will cover this final weakness soon.^ Peter Blomgren,^ 〈[email protected]

〉^ Practical Newton Methods^

— (6/18)

Practical Newton Methods^ IntroductionLine Search Newton-CG MethodNewton-CG — “Inexact Newton Methods”Modified Newton’s Method Inexact Newton Steps If we settle for an inexact (approximate) solution of^2 N^ ∇f^ (˜x)˜p=^ −∇k^ k^

f^ (˜x)k^ then we need a measure of how close our approximate solution

˜pis tok^ the exact Newton direction... Another use of the

residual (^2) ˜r= ∇f^ (˜x)˜p+^ ∇f^ (˜xk k^ k^ ).k Usually we do not want the termination condition for the inexact solutionto depend on the size of^

f^ , hence are interested in the

relative size^ of the residual, and say that an approximate solution is good enough when^ Termination criterion:

‖˜r‖ ≤^ η‖∇f^ (˜x)‖k^ k^ k^

,^ η∈^ (0,^ 1)k^ The sequence^ {η}^ is known as ak^

forcing sequence. Peter Blomgren,^ 〈[email protected]

〉^ Practical Newton Methods^

— (7/18)

Practical Newton Methods^ IntroductionLine Search Newton-CG MethodNewton-CG — “Inexact Newton Methods”Modified Newton’s Method The Forcing Sequence: Convergence^

1 of 3 Selection of the forcing sequence greatly impacts how fast the overallalgorithm converges, as illustrated in the following results: Theorem Suppose that the gradient

∇f^ (˜x)^ is continuously differentiable in a neighborhood^ N^ of a minimizer

∗ ˜x, and assume that the Hessian 2 ∗ ∇f^ (˜x)^ is positive definite. Consider the iteration

˜x=^ ˜x+^ ˜pwherek+1^ k^ k^ ˜r(˜p)^ satisfiesk^ k^ ‖˜r‖ ≤k^

η‖∇f^ (˜x)‖,^ η∈^ (0,^ k^ k^ k^

and assume that^ η≤^ η^ k^

for some^ η^ ∈^ [0,^ 1). Then, if the starting point ∗ ˜xis sufficiently near ˜x, the sequence 0

∗^ {˜x} converges to ˜xlinearly.k That is, for all sufficiently large k we have^ ‖

∗∗˜x− ˜x‖ ≤^ c‖˜x−^ ˜x‖k+1 k^ for some constant c^ ∈^ (

,^ 1). Peter Blomgren, 〈[email protected]〉^ Practical Newton Methods

— (8/18)

Practical Newton MethodsLine Search Newton-CG Method^ Dealing with Negative CurvatureModified Newton’s Method Line Search Newton-CG Method^

3 of 5 Algorithm: “CG-core”(κ)CG˜ Given^ A,^ b,^ η,^ ˜x:^ ˜r^0

CG˜= A˜x−^ b,^ ˜p=^ −˜r,^ k^ = 0^0 (κ)˜ while ( ‖˜r‖ > η‖b‖)^ )k T˜r˜rkk^ α= ,^ k T^ ˜pA˜pkk^ Store the vector^ A˜pkT and the scalar^ ˜r˜rkk^ T if ˜pA˜p≤^0 ,^ k^ >^0 k^ k^ return(˜x)k^ ˜x=^ ˜x+^ α˜pk+1^ k^ k^ k T^ if^ ˜pA˜p≤^0 ,^ k^ = 0k^ k^

return(˜x)k+ ˜r=^ ˜r+^ αA˜pk+1^ k^ k^ k T˜r˜rk+1k+1 β=^ ,^ k+1^ T^ ˜r˜rkk^

Save numerator for next iteration! ˜p=^ −˜r+^ β˜pk+1^ k+1^ k+1k end-while( k = k + 1 ) — The^ ˜p’s are CG-internal search directions,k^

not^ to be confused with the search direction for the optimization algorithm!^ Peter Blomgren,^ 〈[email protected]

〉^ Practical Newton Methods^

— (13/18)

Practical Newton MethodsLine Search Newton-CG Method^ Dealing with Negative CurvatureModified Newton’s Method Line Search Newton-CG Method^

4 of 5 Note:^ If the CG-core algorithm encounters a

direction of nega- tive curvature^ in the first iteration, the steepest descentdirection is used. Line Search Newton-CG Method Given ˜x: k^ = 0 (^0) while ( ˜xis not a minimum )k^2 ˜p=^ CG-core(A^ =^ ∇f^ (˜xk

(κ)^ ˜), b = −∇f (˜x), η=^ η,k k k^ CG˜ ˜x=^0 ) 0 α=^ linesearch(˜p,.. .k^ k^

) ˜x=^ ˜x+^ α˜pk+1^ k^ k^ k end-while ( k = k + 1 ) Where we specify^ ηas discussed earlier, and the linesearch is suchk^ that αsatisfies the Wolfe, Strong Wolfe, Goldstein, or Armijok^ backtracking conditions. Peter Blomgren,^ 〈[email protected]

〉^ Practical Newton Methods^

— (14/18)

Practical Newton MethodsLine Search Newton-CG Method^ Dealing with Negative CurvatureModified Newton’s Method Line Search Newton-CG Method^

5 of 5 Comments: •^ Nothing is stopping us from basing this on the preconditionedversion of CG, in fact that is probably the right thing to do (seeother comments)! •^ Line^ Search^ Newton-CG

(LS-N-CG)^ is^ well^ suited

for^ large problems. • LS-N-CG has one minor weakness — If/When the Hessian isnearly singular,^ the Newton-CG direction can be excessivelylong resulting in many function evaluations in the linesearch. • This^ weakness^ is^ greatly

alleviated^ by^ preconditioning,

i.e. implementing LS-N-PCG(M). Peter Blomgren,^ 〈[email protected]

〉^ Practical Newton Methods^

— (15/18)

Practical Newton MethodsLine Search Newton-CG MethodModified Newton’s Method Modified Newton’s Method^

1 of 2 Sometimes it is desirable to use a direct linear algebra technique, i.e.^ an efficient cousin of Gaussian Elimination, to solve theNewton equations^ ∇

2 Nf^ (˜x)˜p=^ −∇f^ (˜x)k^ k^ k^ If/When the Hessian is not positive definite (or close to singular),it can be modified either before or

during^ the solution process so that in effect we solve^ [^2 ∇f

]N (˜x) + E^ ˜p=^ −∇fk kk^ ︸ ︷︷ ︸ Sufficiently Positive Definite (˜x)k^ Where the Hessian modification

Eis chosen so that the resultingk^ matrix is sufficiently positive definite.^ Peter Blomgren,^ 〈[email protected]

〉^ Practical Newton Methods^

— (16/18)

Practical Newton MethodsLine Search Newton-CG MethodModified Newton’s Method Modified Newton’s Method^

2 of 2 Algorithm: Line Search Newton with Modification Given^ ˜x:^ k^ = 0^0 while (^ ˜xis not a minimum )k^ B=^ factorize(k^

(^2) ∇f^ (˜x) +^ E)k^ k^ − (^1) ˜p= −B∇f (˜x)k k (^) k (^) α= linesearch(˜p,...^ )k k^ ˜x= ˜x+ α˜pk+1 k k k end-while ( k = k + 1 ) Where the linesearch is such that

αsatisfies the Wolfe, Strong Wolfe,k^ Goldstein, or Armijo backtracking conditions.The^ factorization^ algorithm is such that

(^2) E= 0 if ∇f^ (˜x) is sufficientlyk k^ positive definite; otherwise chosen so that

Bis sufficiently positivek^ definite.We save the details of Hessian modification for next lecture...^ Peter Blomgren,^ 〈[email protected]

〉^ Practical Newton Methods^

— (17/18)

Practical Newton MethodsLine Search Newton-CG MethodModified Newton’s Method Projects... “Standard Project” — separate handout. Other... Peter Blomgren, 〈[email protected]〉^ Practical Newton Methods

— (18/18)