ROL
|
#include <ROL_HMCRObjective.hpp>
Public Member Functions | |
virtual | ~HMCRObjective () |
HMCRObjective (Teuchos::RCP< Objective< Real > > &pObj, Real order, Real prob, Teuchos::RCP< SampleGenerator< Real > > &vsampler, Teuchos::RCP< SampleGenerator< Real > > &gsampler, Teuchos::RCP< SampleGenerator< Real > > &hsampler, bool storage=true) | |
HMCRObjective (Teuchos::RCP< Objective< Real > > &pObj, Real order, Real prob, Teuchos::RCP< SampleGenerator< Real > > &vsampler, Teuchos::RCP< SampleGenerator< Real > > &gsampler, bool storage=true) | |
HMCRObjective (Teuchos::RCP< Objective< Real > > &pObj, Real order, Real prob, Teuchos::RCP< SampleGenerator< Real > > &sampler, bool storage=true) | |
void | update (const Vector< Real > &x, bool flag=true, int iter=-1) |
Update objective function. More... | |
Real | value (const Vector< Real > &x, Real &tol) |
Compute value. More... | |
void | gradient (Vector< Real > &g, const Vector< Real > &x, Real &tol) |
Compute gradient. More... | |
void | hessVec (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) |
Apply Hessian approximation to vector. More... | |
virtual void | precond (Vector< Real > &Pv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) |
Apply preconditioner to vector. More... | |
![]() | |
virtual | ~Objective () |
virtual Real | dirDeriv (const Vector< Real > &x, const Vector< Real > &d, Real &tol) |
Compute directional derivative. More... | |
virtual void | invHessVec (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) |
Apply inverse Hessian approximation to vector. More... | |
virtual std::vector< std::vector< Real > > | checkGradient (const Vector< Real > &x, const Vector< Real > &d, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1) |
Finite-difference gradient check. More... | |
virtual std::vector< std::vector< Real > > | checkGradient (const Vector< Real > &x, const Vector< Real > &g, const Vector< Real > &d, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1) |
Finite-difference gradient check. More... | |
virtual std::vector< std::vector< Real > > | checkGradient (const Vector< Real > &x, const Vector< Real > &d, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1) |
Finite-difference gradient check with specified step sizes. More... | |
virtual std::vector< std::vector< Real > > | checkGradient (const Vector< Real > &x, const Vector< Real > &g, const Vector< Real > &d, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1) |
Finite-difference gradient check with specified step sizes. More... | |
virtual std::vector< std::vector< Real > > | checkHessVec (const Vector< Real > &x, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1) |
Finite-difference Hessian-applied-to-vector check. More... | |
virtual std::vector< std::vector< Real > > | checkHessVec (const Vector< Real > &x, const Vector< Real > &hv, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1) |
Finite-difference Hessian-applied-to-vector check. More... | |
virtual std::vector< std::vector< Real > > | checkHessVec (const Vector< Real > &x, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1) |
Finite-difference Hessian-applied-to-vector check with specified step sizes. More... | |
virtual std::vector< std::vector< Real > > | checkHessVec (const Vector< Real > &x, const Vector< Real > &hv, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1) |
Finite-difference Hessian-applied-to-vector check with specified step sizes. More... | |
virtual std::vector< Real > | checkHessSym (const Vector< Real > &x, const Vector< Real > &v, const Vector< Real > &w, const bool printToStream=true, std::ostream &outStream=std::cout) |
Hessian symmetry check. More... | |
virtual std::vector< Real > | checkHessSym (const Vector< Real > &x, const Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &w, const bool printToStream=true, std::ostream &outStream=std::cout) |
Hessian symmetry check. More... | |
virtual void | setParameter (const std::vector< Real > ¶m) |
Private Member Functions | |
void | initialize (const Vector< Real > &x) |
void | unwrap_const_CVaR_vector (Teuchos::RCP< Vector< Real > > &xvec, Real &xvar, const Vector< Real > &x) |
void | getValue (Real &val, const Vector< Real > &x, const std::vector< Real > ¶m, Real &tol) |
void | getGradient (Vector< Real > &g, const Vector< Real > &x, const std::vector< Real > ¶m, Real &tol) |
void | getHessVec (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, const std::vector< Real > ¶m, Real &tol) |
Private Attributes | |
Teuchos::RCP< Objective< Real > > | ParametrizedObjective_ |
Real | order_ |
Real | prob_ |
Teuchos::RCP< SampleGenerator< Real > > | ValueSampler_ |
Teuchos::RCP< SampleGenerator< Real > > | GradientSampler_ |
Teuchos::RCP< SampleGenerator< Real > > | HessianSampler_ |
Teuchos::RCP< Vector< Real > > | pointGrad_ |
Teuchos::RCP< Vector< Real > > | pointHess_ |
Teuchos::RCP< Vector< Real > > | gradient0_ |
Teuchos::RCP< Vector< Real > > | sumGrad0_ |
Teuchos::RCP< Vector< Real > > | gradient1_ |
Teuchos::RCP< Vector< Real > > | sumGrad1_ |
Teuchos::RCP< Vector< Real > > | gradient2_ |
Teuchos::RCP< Vector< Real > > | sumGrad2_ |
Teuchos::RCP< Vector< Real > > | hessvec_ |
Teuchos::RCP< Vector< Real > > | sumHess_ |
bool | initialized_ |
bool | storage_ |
std::map< std::vector< Real >, Real > | value_storage_ |
std::map< std::vector< Real >, Teuchos::RCP< Vector< Real > > > | gradient_storage_ |
Additional Inherited Members | |
![]() | |
const std::vector< Real > | getParameter (void) const |
Definition at line 55 of file ROL_HMCRObjective.hpp.
|
inlinevirtual |
Definition at line 145 of file ROL_HMCRObjective.hpp.
|
inline |
Definition at line 147 of file ROL_HMCRObjective.hpp.
References ROL::HMCRObjective< Real >::gradient_storage_, ROL::HMCRObjective< Real >::order_, ROL::HMCRObjective< Real >::prob_, and ROL::HMCRObjective< Real >::value_storage_.
|
inline |
Definition at line 162 of file ROL_HMCRObjective.hpp.
References ROL::HMCRObjective< Real >::gradient_storage_, ROL::HMCRObjective< Real >::order_, ROL::HMCRObjective< Real >::prob_, and ROL::HMCRObjective< Real >::value_storage_.
|
inline |
Definition at line 176 of file ROL_HMCRObjective.hpp.
References ROL::HMCRObjective< Real >::gradient_storage_, ROL::HMCRObjective< Real >::order_, ROL::HMCRObjective< Real >::prob_, and ROL::HMCRObjective< Real >::value_storage_.
|
inlineprivate |
Definition at line 84 of file ROL_HMCRObjective.hpp.
References ROL::Vector< Real >::dual(), ROL::HMCRObjective< Real >::gradient0_, ROL::HMCRObjective< Real >::gradient1_, ROL::HMCRObjective< Real >::gradient2_, ROL::HMCRObjective< Real >::hessvec_, ROL::HMCRObjective< Real >::initialized_, ROL::HMCRObjective< Real >::pointGrad_, ROL::HMCRObjective< Real >::pointHess_, ROL::HMCRObjective< Real >::sumGrad0_, ROL::HMCRObjective< Real >::sumGrad1_, ROL::HMCRObjective< Real >::sumGrad2_, and ROL::HMCRObjective< Real >::sumHess_.
Referenced by ROL::HMCRObjective< Real >::unwrap_const_CVaR_vector().
|
inlineprivate |
Definition at line 98 of file ROL_HMCRObjective.hpp.
References ROL::HMCRObjective< Real >::initialize(), and ROL::HMCRObjective< Real >::initialized_.
Referenced by ROL::HMCRObjective< Real >::gradient(), ROL::HMCRObjective< Real >::hessVec(), ROL::HMCRObjective< Real >::update(), and ROL::HMCRObjective< Real >::value().
|
inlineprivate |
Definition at line 107 of file ROL_HMCRObjective.hpp.
References ROL::HMCRObjective< Real >::ParametrizedObjective_, ROL::HMCRObjective< Real >::storage_, and ROL::HMCRObjective< Real >::value_storage_.
Referenced by ROL::HMCRObjective< Real >::gradient(), ROL::HMCRObjective< Real >::hessVec(), and ROL::HMCRObjective< Real >::value().
|
inlineprivate |
Definition at line 121 of file ROL_HMCRObjective.hpp.
References ROL::Vector< Real >::clone(), ROL::HMCRObjective< Real >::gradient_storage_, ROL::HMCRObjective< Real >::ParametrizedObjective_, ROL::Vector< Real >::set(), and ROL::HMCRObjective< Real >::storage_.
Referenced by ROL::HMCRObjective< Real >::gradient(), and ROL::HMCRObjective< Real >::hessVec().
|
inlineprivate |
Definition at line 137 of file ROL_HMCRObjective.hpp.
References ROL::HMCRObjective< Real >::ParametrizedObjective_.
Referenced by ROL::HMCRObjective< Real >::hessVec().
|
inlinevirtual |
Update objective function.
This function updates the objective function at new iterations.
[in] | x | is the new iterate. |
[in] | flag | is true if the iterate has changed. |
[in] | iter | is the outer algorithm iterations count. |
Reimplemented from ROL::Objective< Real >.
Definition at line 189 of file ROL_HMCRObjective.hpp.
References ROL::HMCRObjective< Real >::gradient_storage_, ROL::HMCRObjective< Real >::GradientSampler_, ROL::HMCRObjective< Real >::HessianSampler_, ROL::HMCRObjective< Real >::ParametrizedObjective_, ROL::HMCRObjective< Real >::storage_, ROL::HMCRObjective< Real >::unwrap_const_CVaR_vector(), ROL::HMCRObjective< Real >::value_storage_, and ROL::HMCRObjective< Real >::ValueSampler_.
|
inlinevirtual |
Compute value.
This function returns the objective function value.
[in] | x | is the current iterate. |
[in] | tol | is a tolerance for inexact objective function computation. |
Implements ROL::Objective< Real >.
Definition at line 206 of file ROL_HMCRObjective.hpp.
References ROL::HMCRObjective< Real >::getValue(), ROL::HMCRObjective< Real >::order_, ROL::HMCRObjective< Real >::prob_, ROL::HMCRObjective< Real >::unwrap_const_CVaR_vector(), and ROL::HMCRObjective< Real >::ValueSampler_.
|
inlinevirtual |
Compute gradient.
This function returns the objective function gradient.
[out] | g | is the gradient. |
[in] | x | is the current iterate. |
[in] | tol | is a tolerance for inexact objective function computation. |
The default implementation is a finite-difference approximation based on the function value. This requires the definition of a basis \(\{\phi_i\}\) for the optimization vectors x and the definition of a basis \(\{\psi_j\}\) for the dual optimization vectors (gradient vectors g). The bases must be related through the Riesz map, i.e., \( R \{\phi_i\} = \{\psi_j\}\), and this must be reflected in the implementation of the ROL::Vector::dual() method.
Reimplemented from ROL::Objective< Real >.
Definition at line 235 of file ROL_HMCRObjective.hpp.
References ROL::HMCRObjective< Real >::getGradient(), ROL::HMCRObjective< Real >::getValue(), ROL::HMCRObjective< Real >::gradient0_, ROL::HMCRObjective< Real >::GradientSampler_, ROL::HMCRObjective< Real >::order_, ROL::HMCRObjective< Real >::pointGrad_, ROL::HMCRObjective< Real >::prob_, ROL::RiskVector< Real >::setStatistic(), ROL::RiskVector< Real >::setVector(), ROL::HMCRObjective< Real >::sumGrad0_, ROL::HMCRObjective< Real >::unwrap_const_CVaR_vector(), and ROL::Vector< Real >::zero().
|
inlinevirtual |
Apply Hessian approximation to vector.
This function applies the Hessian of the objective function to the vector \(v\).
[out] | hv | is the the action of the Hessian on \(v\). |
[in] | v | is the direction vector. |
[in] | x | is the current iterate. |
[in] | tol | is a tolerance for inexact objective function computation. |
Reimplemented from ROL::Objective< Real >.
Definition at line 282 of file ROL_HMCRObjective.hpp.
References ROL::HMCRObjective< Real >::getGradient(), ROL::HMCRObjective< Real >::getHessVec(), ROL::HMCRObjective< Real >::getValue(), ROL::HMCRObjective< Real >::gradient0_, ROL::HMCRObjective< Real >::gradient1_, ROL::HMCRObjective< Real >::gradient2_, ROL::HMCRObjective< Real >::HessianSampler_, ROL::HMCRObjective< Real >::hessvec_, ROL::HMCRObjective< Real >::order_, ROL::HMCRObjective< Real >::pointGrad_, ROL::HMCRObjective< Real >::pointHess_, ROL::HMCRObjective< Real >::prob_, ROL::RiskVector< Real >::setStatistic(), ROL::RiskVector< Real >::setVector(), ROL::HMCRObjective< Real >::sumGrad0_, ROL::HMCRObjective< Real >::sumGrad1_, ROL::HMCRObjective< Real >::sumGrad2_, ROL::HMCRObjective< Real >::sumHess_, ROL::HMCRObjective< Real >::unwrap_const_CVaR_vector(), and ROL::Vector< Real >::zero().
|
inlinevirtual |
Apply preconditioner to vector.
This function applies a preconditioner for the Hessian of the objective function to the vector \(v\).
[out] | Pv | is the action of the Hessian preconditioner on \(v\). |
[in] | v | is the direction vector. |
[in] | x | is the current iterate. |
[in] | tol | is a tolerance for inexact objective function computation. |
Reimplemented from ROL::Objective< Real >.
Definition at line 360 of file ROL_HMCRObjective.hpp.
References ROL::Vector< Real >::dual(), and ROL::Vector< Real >::set().
|
private |
Definition at line 57 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::getGradient(), ROL::HMCRObjective< Real >::getHessVec(), ROL::HMCRObjective< Real >::getValue(), and ROL::HMCRObjective< Real >::update().
|
private |
Definition at line 59 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::gradient(), ROL::HMCRObjective< Real >::hessVec(), ROL::HMCRObjective< Real >::HMCRObjective(), and ROL::HMCRObjective< Real >::value().
|
private |
Definition at line 60 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::gradient(), ROL::HMCRObjective< Real >::hessVec(), ROL::HMCRObjective< Real >::HMCRObjective(), and ROL::HMCRObjective< Real >::value().
|
private |
Definition at line 62 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::update(), and ROL::HMCRObjective< Real >::value().
|
private |
Definition at line 63 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::gradient(), and ROL::HMCRObjective< Real >::update().
|
private |
Definition at line 64 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::hessVec(), and ROL::HMCRObjective< Real >::update().
|
private |
Definition at line 66 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::gradient(), ROL::HMCRObjective< Real >::hessVec(), and ROL::HMCRObjective< Real >::initialize().
|
private |
Definition at line 67 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::hessVec(), and ROL::HMCRObjective< Real >::initialize().
|
private |
Definition at line 69 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::gradient(), ROL::HMCRObjective< Real >::hessVec(), and ROL::HMCRObjective< Real >::initialize().
|
private |
Definition at line 70 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::gradient(), ROL::HMCRObjective< Real >::hessVec(), and ROL::HMCRObjective< Real >::initialize().
|
private |
Definition at line 71 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::hessVec(), and ROL::HMCRObjective< Real >::initialize().
|
private |
Definition at line 72 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::hessVec(), and ROL::HMCRObjective< Real >::initialize().
|
private |
Definition at line 73 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::hessVec(), and ROL::HMCRObjective< Real >::initialize().
|
private |
Definition at line 74 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::hessVec(), and ROL::HMCRObjective< Real >::initialize().
|
private |
Definition at line 75 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::hessVec(), and ROL::HMCRObjective< Real >::initialize().
|
private |
Definition at line 76 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::hessVec(), and ROL::HMCRObjective< Real >::initialize().
|
private |
Definition at line 78 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::initialize(), and ROL::HMCRObjective< Real >::unwrap_const_CVaR_vector().
|
private |
Definition at line 79 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::getGradient(), ROL::HMCRObjective< Real >::getValue(), and ROL::HMCRObjective< Real >::update().
|
private |
Definition at line 81 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::getValue(), ROL::HMCRObjective< Real >::HMCRObjective(), and ROL::HMCRObjective< Real >::update().
|
private |
Definition at line 82 of file ROL_HMCRObjective.hpp.
Referenced by ROL::HMCRObjective< Real >::getGradient(), ROL::HMCRObjective< Real >::HMCRObjective(), and ROL::HMCRObjective< Real >::update().