ROL
|
Provides an interface to run the trust-region algorithm. More...
#include <ROL_TypeP_TrustRegionAlgorithm.hpp>
Public Member Functions | |
TrustRegionAlgorithm (ParameterList &list, const Ptr< Secant< Real >> &secant=nullPtr) | |
void | run (Vector< Real > &x, const Vector< Real > &g, Objective< Real > &sobj, Objective< Real > &nobj, std::ostream &outStream=std::cout) override |
Run algorithm on unconstrained problems (Type-U). This general interface supports the use of dual optimization vector spaces, where the user does not define the dual() method. More... | |
void | writeHeader (std::ostream &os) const override |
Print iterate header. More... | |
void | writeName (std::ostream &os) const override |
Print step name. More... | |
void | writeOutput (std::ostream &os, bool write_header=false) const override |
Print iterate status. More... | |
Public Member Functions inherited from ROL::TypeP::Algorithm< Real > | |
virtual | ~Algorithm () |
Algorithm () | |
Constructor, given a step and a status test. More... | |
void | setStatusTest (const Ptr< StatusTest< Real >> &status, bool combineStatus=false) |
virtual void | run (Problem< Real > &problem, std::ostream &outStream=std::cout) |
Run algorithm on unconstrained problems (Type-U). This is the primary Type-U interface. More... | |
virtual void | run (Vector< Real > &x, Objective< Real > &sobj, Objective< Real > &nobj, std::ostream &outStream=std::cout) |
Run algorithm on unconstrained problems (Type-U). This is the primary Type-U interface. More... | |
virtual void | writeExitStatus (std::ostream &os) const |
Ptr< const AlgorithmState< Real > > | getState () const |
void | reset () |
Private Member Functions | |
void | initialize (Vector< Real > &x, const Vector< Real > &g, Real ftol, Objective< Real > &sobj, Objective< Real > &nobj, Vector< Real > &px, Vector< Real > &dg, std::ostream &outStream=std::cout) |
Real | computeValue (Real inTol, Real &outTol, Real pRed, Real &fold, int iter, const Vector< Real > &x, const Vector< Real > &xold, Objective< Real > &obj) |
void | computeGradient (const Vector< Real > &x, Vector< Real > &g, Vector< Real > &px, Vector< Real > &dg, Vector< Real > &pwa, Real del, Objective< Real > &sobj, Objective< Real > &nobj, bool accept, Real >ol, Real &gnorm, std::ostream &outStream=std::cout) const |
Real | dcauchy (Vector< Real > &s, Real &alpha, Real &sval, Real &nval, const Vector< Real > &x, const Vector< Real > &g, Real del, TrustRegionModel_U< Real > &model, Objective< Real > &nobj, Vector< Real > &px, Vector< Real > &dwa, Vector< Real > &dwa1, std::ostream &outStream=std::cout) |
void | dspg2 (Vector< Real > &y, Real &sval, Real &nval, Real &pRed, Vector< Real > &gmod, const Vector< Real > &x, Real del, TrustRegionModel_U< Real > &model, Objective< Real > &nobj, Vector< Real > &pwa, Vector< Real > &pwa1, Vector< Real > &pwa2, Vector< Real > &dwa, std::ostream &outStream=std::cout) |
void | dspg (Vector< Real > &y, Real &sval, Real &nval, Vector< Real > &gmod, const Vector< Real > &x, Real del, TrustRegionModel_U< Real > &model, Objective< Real > &nobj, Vector< Real > &ymin, Vector< Real > &pwa, Vector< Real > &pwa1, Vector< Real > &pwa2, Vector< Real > &pwa3, Vector< Real > &pwa4, Vector< Real > &pwa5, Vector< Real > &dwa, std::ostream &outStream=std::cout) |
void | dncg (Vector< Real > &y, Real &sval, Real &nval, Vector< Real > &gmod, const Vector< Real > &x, Real del, TrustRegionModel_U< Real > &model, Objective< Real > &nobj, Vector< Real > &s, Vector< Real > &pwa1, Vector< Real > &pwa2, Vector< Real > &pwa3, Vector< Real > &pwa4, Vector< Real > &pwa5, Vector< Real > &dwa, std::ostream &outStream=std::cout) |
void | dprox (Vector< Real > &x, const Vector< Real > &x0, Real t, Real del, Objective< Real > &nobj, Vector< Real > &y0, Vector< Real > &y1, Vector< Real > &yc, Vector< Real > &pwa, std::ostream &outStream=std::cout) const |
void | dbls (Real &alpha, Real &nval, Real &pred, const Vector< Real > &y, const Vector< Real > &s, Real lambda, Real tmax, Real kappa, Real gs, Objective< Real > &nobj, Vector< Real > &pwa) |
Private Attributes | |
Ptr< TrustRegionModel_U< Real > > | model_ |
Container for trust-region model. More... | |
Real | delMax_ |
Maximum trust-region radius (default: ROL_INF) More... | |
Real | eta0_ |
Step acceptance threshold (default: 0.05) More... | |
Real | eta1_ |
Radius decrease threshold (default: 0.05) More... | |
Real | eta2_ |
Radius increase threshold (default: 0.9) More... | |
Real | gamma0_ |
Radius decrease rate (negative rho) (default: 0.0625) More... | |
Real | gamma1_ |
Radius decrease rate (positive rho) (default: 0.25) More... | |
Real | gamma2_ |
Radius increase rate (default: 2.5) More... | |
Real | TRsafe_ |
Safeguard size for numerically evaluating ratio (default: 1e2) More... | |
Real | eps_ |
Safeguard for numerically evaluating ratio. More... | |
bool | interpRad_ |
Interpolate the trust-region radius if ratio is negative (default: false) More... | |
TRUtils::ETRFlag | TRflag_ |
Trust-region exit flag. More... | |
int | SPflag_ |
Subproblem solver termination flag. More... | |
int | SPiter_ |
Subproblem solver iteration count. More... | |
ESecant | esec_ |
Secant type (default: Limited-Memory BFGS) More... | |
bool | useSecantPrecond_ |
Flag to use secant as a preconditioner (default: false) More... | |
bool | useSecantHessVec_ |
Flag to use secant as Hessian (default: false) More... | |
Real | tol1_ |
Absolute tolerance for truncated CG (default: 1e-4) More... | |
Real | tol2_ |
Relative tolerance for truncated CG (default: 1e-2) More... | |
int | maxit_ |
Maximum number of CG iterations (default: 25) More... | |
bool | useNM_ |
int | storageNM_ |
Real | mu0_ |
Sufficient decrease parameter (default: 1e-2) More... | |
Real | spexp_ |
Relative tolerance exponent for subproblem solve (default: 1, range: [1,2]) More... | |
int | redlim_ |
Maximum number of Cauchy point reduction steps (default: 10) More... | |
int | explim_ |
Maximum number of Cauchy point expansion steps (default: 10) More... | |
Real | alpha_ |
Initial Cauchy point step length (default: 1.0) More... | |
bool | normAlpha_ |
Normalize initial Cauchy point step length (default: false) More... | |
Real | interpf_ |
Backtracking rate for Cauchy point computation (default: 1e-1) More... | |
Real | extrapf_ |
Extrapolation rate for Cauchy point computation (default: 1e1) More... | |
Real | qtol_ |
Relative tolerance for computed decrease in Cauchy point computation (default: 1-8) More... | |
Real | lambdaMin_ |
Real | lambdaMax_ |
Real | gamma_ |
int | maxSize_ |
bool | useMin_ |
bool | useNMSP_ |
ETrustRegionP | algSelect_ |
int | ncgType_ |
Real | etaNCG_ |
Real | desPar_ |
std::vector< bool > | useInexact_ |
Real | scale0_ |
Real | scale1_ |
Real | scale_ |
Real | omega_ |
Real | force_ |
int | updateIter_ |
Real | forceFactor_ |
Real | gtol_ |
bool | initProx_ |
Real | t0_ |
int | nhess_ |
Number of Hessian applications. More... | |
unsigned | verbosity_ |
Output level (default: 0) More... | |
bool | writeHeader_ |
Flag to write header at every iteration. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from ROL::TypeP::Algorithm< Real > | |
void | initialize (const Vector< Real > &x, const Vector< Real > &g) |
void | pgstep (Vector< Real > &pgiter, Vector< Real > &pgstep, Objective< Real > &nobj, const Vector< Real > &x, const Vector< Real > &dg, Real t, Real &tol) const |
Protected Attributes inherited from ROL::TypeP::Algorithm< Real > | |
const Ptr< CombinedStatusTest < Real > > | status_ |
const Ptr< AlgorithmState< Real > > | state_ |
Provides an interface to run the trust-region algorithm.
Definition at line 117 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
ROL::TypeP::TrustRegionAlgorithm< Real >::TrustRegionAlgorithm | ( | ParameterList & | list, |
const Ptr< Secant< Real >> & | secant = nullPtr |
||
) |
Definition at line 54 of file ROL_TypeP_TrustRegionAlgorithm_Def.hpp.
References ROL::SECANTMODE_BOTH, ROL::SECANTMODE_FORWARD, ROL::SECANTMODE_INVERSE, ROL::StringToESecant(), and ROL::TypeP::StringToETrustRegionP().
|
private |
Definition at line 142 of file ROL_TypeP_TrustRegionAlgorithm_Def.hpp.
References ROL::Initial, ROL::TypeP::Algorithm< Real >::initialize(), ROL::Objective< Real >::prox(), ROL::Vector< Real >::set(), ROL::Objective< Real >::update(), and ROL::Objective< Real >::value().
|
overridevirtual |
Run algorithm on unconstrained problems (Type-U). This general interface supports the use of dual optimization vector spaces, where the user does not define the dual() method.
Implements ROL::TypeP::Algorithm< Real >.
Definition at line 238 of file ROL_TypeP_TrustRegionAlgorithm_Def.hpp.
References ROL::Accept, ROL::Vector< Real >::clone(), ROL::TRUtils::NPOSPREDNEG, ROL::Vector< Real >::plus(), ROL::TRUtils::POSPREDNEG, ROL::Revert, ROL::Vector< Real >::set(), ROL::TRUtils::SUCCESS, ROL::TRUtils::TRNAN, ROL::TypeP::TRUSTREGION_P_NCG, ROL::TypeP::TRUSTREGION_P_SPG, ROL::TypeP::TRUSTREGION_P_SPG2, ROL::Objective< Real >::update(), ROL::TypeP::Algorithm< Real >::writeExitStatus(), and zero.
|
overridevirtual |
Print iterate header.
Reimplemented from ROL::TypeP::Algorithm< Real >.
Definition at line 1172 of file ROL_TypeP_TrustRegionAlgorithm_Def.hpp.
References ROL::TRUtils::ETRFlagToString(), ROL::NumberToString(), ROL::TRUtils::SUCCESS, ROL::TypeP::TRUSTREGION_P_NCG, ROL::TypeP::TRUSTREGION_P_SPG, ROL::TypeP::TRUSTREGION_P_SPG2, and ROL::TRUtils::UNDEFINED.
|
overridevirtual |
Print step name.
Reimplemented from ROL::TypeP::Algorithm< Real >.
Definition at line 1225 of file ROL_TypeP_TrustRegionAlgorithm_Def.hpp.
References ROL::TypeP::TRUSTREGION_P_NCG, ROL::TypeP::TRUSTREGION_P_SPG, and ROL::TypeP::TRUSTREGION_P_SPG2.
|
overridevirtual |
Print iterate status.
Reimplemented from ROL::TypeP::Algorithm< Real >.
Definition at line 1239 of file ROL_TypeP_TrustRegionAlgorithm_Def.hpp.
|
private |
Definition at line 176 of file ROL_TypeP_TrustRegionAlgorithm_Def.hpp.
References ROL::Trial, ROL::Objective< Real >::update(), and ROL::Objective< Real >::value().
|
private |
Definition at line 201 of file ROL_TypeP_TrustRegionAlgorithm_Def.hpp.
References ROL::Vector< Real >::dual(), ROL::Objective< Real >::gradient(), ROL::Vector< Real >::norm(), and ROL::Vector< Real >::set().
|
private |
Definition at line 378 of file ROL_TypeP_TrustRegionAlgorithm_Def.hpp.
References ROL::Vector< Real >::apply(), ROL::Vector< Real >::dot(), ROL::TrustRegionModel_U< Real >::hessVec(), ROL::Vector< Real >::norm(), ROL::Vector< Real >::set(), ROL::Trial, ROL::Objective< Real >::update(), and ROL::Objective< Real >::value().
|
private |
Definition at line 485 of file ROL_TypeP_TrustRegionAlgorithm_Def.hpp.
References ROL::Vector< Real >::apply(), ROL::Vector< Real >::axpy(), ROL::Vector< Real >::dot(), ROL::Vector< Real >::dual(), ROL::TrustRegionModel_U< Real >::hessVec(), ROL::Vector< Real >::norm(), ROL::Vector< Real >::plus(), ROL::Vector< Real >::set(), ROL::Trial, ROL::Objective< Real >::update(), ROL::Objective< Real >::value(), and ROL::Vector< Real >::zero().
|
private |
Definition at line 600 of file ROL_TypeP_TrustRegionAlgorithm_Def.hpp.
References ROL::Accept, ROL::Vector< Real >::apply(), ROL::Vector< Real >::axpy(), ROL::Vector< Real >::dot(), ROL::Vector< Real >::dual(), ROL::TrustRegionModel_U< Real >::hessVec(), ROL::Vector< Real >::norm(), ROL::Vector< Real >::set(), ROL::Trial, ROL::Objective< Real >::update(), and ROL::Objective< Real >::value().
|
private |
Definition at line 984 of file ROL_TypeP_TrustRegionAlgorithm_Def.hpp.
References ROL::Vector< Real >::apply(), ROL::Vector< Real >::axpy(), ROL::Vector< Real >::dot(), ROL::Vector< Real >::dual(), ROL::TrustRegionModel_U< Real >::hessVec(), ROL::Vector< Real >::norm(), ROL::Vector< Real >::plus(), ROL::Vector< Real >::scale(), ROL::Vector< Real >::set(), ROL::Trial, ROL::Objective< Real >::update(), ROL::Objective< Real >::value(), zero, and ROL::Vector< Real >::zero().
|
private |
Definition at line 751 of file ROL_TypeP_TrustRegionAlgorithm_Def.hpp.
References ROL::Vector< Real >::axpy(), ROL::Vector< Real >::norm(), ROL::Objective< Real >::prox(), ROL::Vector< Real >::scale(), ROL::Vector< Real >::set(), and zero.
|
private |
Definition at line 847 of file ROL_TypeP_TrustRegionAlgorithm_Def.hpp.
References ROL::Vector< Real >::axpy(), ROL::Vector< Real >::set(), ROL::Trial, ROL::Objective< Real >::update(), ROL::Objective< Real >::value(), and zero.
|
private |
Container for trust-region model.
Definition at line 119 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Maximum trust-region radius (default: ROL_INF)
Definition at line 122 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Step acceptance threshold (default: 0.05)
Definition at line 123 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Radius decrease threshold (default: 0.05)
Definition at line 124 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Radius increase threshold (default: 0.9)
Definition at line 125 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Radius decrease rate (negative rho) (default: 0.0625)
Definition at line 126 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Radius decrease rate (positive rho) (default: 0.25)
Definition at line 127 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Radius increase rate (default: 2.5)
Definition at line 128 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Safeguard size for numerically evaluating ratio (default: 1e2)
Definition at line 129 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Safeguard for numerically evaluating ratio.
Definition at line 130 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Interpolate the trust-region radius if ratio is negative (default: false)
Definition at line 131 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Trust-region exit flag.
Definition at line 134 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Subproblem solver termination flag.
Definition at line 135 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Subproblem solver iteration count.
Definition at line 136 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Secant type (default: Limited-Memory BFGS)
Definition at line 139 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Flag to use secant as a preconditioner (default: false)
Definition at line 140 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Flag to use secant as Hessian (default: false)
Definition at line 141 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Absolute tolerance for truncated CG (default: 1e-4)
Definition at line 144 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Relative tolerance for truncated CG (default: 1e-2)
Definition at line 145 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Maximum number of CG iterations (default: 25)
Definition at line 146 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 149 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 150 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Sufficient decrease parameter (default: 1e-2)
Definition at line 151 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Relative tolerance exponent for subproblem solve (default: 1, range: [1,2])
Definition at line 152 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Maximum number of Cauchy point reduction steps (default: 10)
Definition at line 153 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Maximum number of Cauchy point expansion steps (default: 10)
Definition at line 154 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Initial Cauchy point step length (default: 1.0)
Definition at line 155 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Normalize initial Cauchy point step length (default: false)
Definition at line 156 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Backtracking rate for Cauchy point computation (default: 1e-1)
Definition at line 157 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Extrapolation rate for Cauchy point computation (default: 1e1)
Definition at line 158 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Relative tolerance for computed decrease in Cauchy point computation (default: 1-8)
Definition at line 159 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 160 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 161 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 162 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 163 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 164 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 165 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 166 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 167 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 168 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 169 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 172 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 173 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 174 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 175 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 176 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 177 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 178 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 179 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 180 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 182 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Definition at line 183 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
mutableprivate |
Number of Hessian applications.
Definition at line 185 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Output level (default: 0)
Definition at line 186 of file ROL_TypeP_TrustRegionAlgorithm.hpp.
|
private |
Flag to write header at every iteration.
Definition at line 187 of file ROL_TypeP_TrustRegionAlgorithm.hpp.