ROL
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ROL::MeanDeviationFromTarget< Real > Class Template Reference

Provides an interface for the mean plus a sum of arbitrary order deviations from targets. More...

#include <ROL_MeanDeviationFromTarget.hpp>

+ Inheritance diagram for ROL::MeanDeviationFromTarget< Real >:

Public Member Functions

 MeanDeviationFromTarget (const Real target, const Real order, const Real coeff, const Ptr< PositiveFunction< Real > > &pf)
 Constructor. More...
 
 MeanDeviationFromTarget (const std::vector< Real > &target, const std::vector< Real > &order, const std::vector< Real > &coeff, const Ptr< PositiveFunction< Real > > &pf)
 Constructor. More...
 
 MeanDeviationFromTarget (ROL::ParameterList &parlist)
 Constructor. More...
 
void initialize (const Vector< Real > &x)
 Initialize temporary variables. More...
 
void updateValue (Objective< Real > &obj, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol)
 Update internal storage for value computation. More...
 
Real getValue (const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler)
 Return risk measure value. More...
 
void updateGradient (Objective< Real > &obj, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol)
 Update internal risk measure storage for gradient computation. More...
 
void getGradient (Vector< Real > &g, std::vector< Real > &gstat, const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler)
 Return risk measure (sub)gradient. More...
 
void updateHessVec (Objective< Real > &obj, const Vector< Real > &v, const std::vector< Real > &vstat, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol)
 Update internal risk measure storage for Hessian-time-a-vector computation. More...
 
void getHessVec (Vector< Real > &hv, std::vector< Real > &hvstat, const Vector< Real > &v, const std::vector< Real > &vstat, const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler)
 Return risk measure Hessian-times-a-vector. More...
 
- Public Member Functions inherited from ROL::RandVarFunctional< Real >
virtual ~RandVarFunctional ()
 
 RandVarFunctional (void)
 
 weight_ (0)
 
void useStorage (bool storage)
 
void useHessVecStorage (bool storage)
 
virtual void setStorage (const Ptr< SampledScalar< Real >> &value_storage, const Ptr< SampledVector< Real >> &gradient_storage)
 
virtual void setHessVecStorage (const Ptr< SampledScalar< Real >> &gradvec_storage, const Ptr< SampledVector< Real >> &hessvec_storage)
 
virtual void resetStorage (bool flag=true)
 Reset internal storage. More...
 
virtual void setSample (const std::vector< Real > &point, const Real weight)
 
virtual Real computeStatistic (const Ptr< const std::vector< Real >> &xstat) const
 Compute statistic. More...
 

Private Types

typedef std::vector< Real >
::size_type 
uint
 

Private Member Functions

void initializeMDT (void)
 
void checkInputs (void)
 

Private Attributes

Ptr< PositiveFunction< Real > > positiveFunction_
 
std::vector< Real > target_
 
std::vector< Real > order_
 
std::vector< Real > coeff_
 
uint NumMoments_
 
std::vector< Real > pval_
 
std::vector< Real > pgv_
 
std::vector< Ptr< Vector< Real > > > pg0_
 
std::vector< Ptr< Vector< Real > > > pg_
 
std::vector< Ptr< Vector< Real > > > phv_
 
bool firstResetMDT_
 

Additional Inherited Members

- Protected Member Functions inherited from ROL::RandVarFunctional< Real >
Real computeValue (Objective< Real > &obj, const Vector< Real > &x, Real &tol)
 
void computeGradient (Vector< Real > &g, Objective< Real > &obj, const Vector< Real > &x, Real &tol)
 
Real computeGradVec (Vector< Real > &g, Objective< Real > &obj, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
 
void computeHessVec (Vector< Real > &hv, Objective< Real > &obj, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
 
- Protected Attributes inherited from ROL::RandVarFunctional< Real >
Real val_
 
Real gv_
 
Ptr< Vector< Real > > g_
 
Ptr< Vector< Real > > hv_
 
Ptr< Vector< Real > > dualVector_
 
bool firstReset_
 
std::vector< Real > point_
 
Real weight_
 

Detailed Description

template<class Real>
class ROL::MeanDeviationFromTarget< Real >

Provides an interface for the mean plus a sum of arbitrary order deviations from targets.

The mean plus deviations from targets risk measure is

\[ \mathcal{R}(X) = \mathbb{E}[X] + \sum_{k=1}^n c_k \mathbb{E}[\wp(X-t_k)^{p_k}]^{1/p_k} \]

where \(\wp:\mathbb{R}\to[0,\infty)\) is either the absolute value or \((x)_+ = \max\{0,x\}\), \(c_k > 0\) and \(p_k\in\mathbb{N}\). In general, \(\mathcal{R}\) is law-invariant, but not coherent since it violates translation equivariance.

When using derivative-based optimization, the user can provide a smooth approximation of \((\cdot)_+\) using the ROL::PositiveFunction class.

Definition at line 76 of file ROL_MeanDeviationFromTarget.hpp.

Member Typedef Documentation

template<class Real >
typedef std::vector<Real>::size_type ROL::MeanDeviationFromTarget< Real >::uint
private

Definition at line 77 of file ROL_MeanDeviationFromTarget.hpp.

Constructor & Destructor Documentation

template<class Real >
ROL::MeanDeviationFromTarget< Real >::MeanDeviationFromTarget ( const Real  target,
const Real  order,
const Real  coeff,
const Ptr< PositiveFunction< Real > > &  pf 
)
inline

Constructor.

Parameters
[in]targetis the target scalar value
[in]orderis the deviation order
[in]coeffis the weight for deviation term
[in]pfis the plus function or an approximation

This constructor produces a mean plus deviation from target risk measure with a single deviation.

Definition at line 147 of file ROL_MeanDeviationFromTarget.hpp.

References ROL::MeanDeviationFromTarget< Real >::checkInputs(), ROL::MeanDeviationFromTarget< Real >::coeff_, ROL::MeanDeviationFromTarget< Real >::NumMoments_, ROL::MeanDeviationFromTarget< Real >::order_, and ROL::MeanDeviationFromTarget< Real >::target_.

template<class Real >
ROL::MeanDeviationFromTarget< Real >::MeanDeviationFromTarget ( const std::vector< Real > &  target,
const std::vector< Real > &  order,
const std::vector< Real > &  coeff,
const Ptr< PositiveFunction< Real > > &  pf 
)
inline

Constructor.

Parameters
[in]targetis a vector of targets
[in]orderis a vector of deviation orders
[in]coeffis a vector of weights for the deviation terms
[in]pfis the plus function or an approximation

This constructor produces a mean plus deviation from target risk measure with an arbitrary number of deviations.

Definition at line 167 of file ROL_MeanDeviationFromTarget.hpp.

References ROL::MeanDeviationFromTarget< Real >::checkInputs(), ROL::MeanDeviationFromTarget< Real >::coeff_, ROL::MeanDeviationFromTarget< Real >::NumMoments_, ROL::MeanDeviationFromTarget< Real >::order_, and ROL::MeanDeviationFromTarget< Real >::target_.

template<class Real >
ROL::MeanDeviationFromTarget< Real >::MeanDeviationFromTarget ( ROL::ParameterList &  parlist)
inline

Constructor.

Parameters
[in]parlistis a parameter list specifying inputs

parlist should contain sublists "SOL"->"Risk Measure"->"Mean Plus Deviation From Target" and within the "Mean Plus Deviation From Target" sublist should have the following parameters

  • "Targets" (array of scalars)
  • "Orders" (array of unsigned integers)
  • "Coefficients" (array of positive scalars)
  • "Deviation Type" (eighter "Upper" or "Absolute")
  • A sublist for positive function information.

Definition at line 198 of file ROL_MeanDeviationFromTarget.hpp.

References ROL::MeanDeviationFromTarget< Real >::checkInputs(), ROL::MeanDeviationFromTarget< Real >::coeff_, ROL::MeanDeviationFromTarget< Real >::NumMoments_, ROL::MeanDeviationFromTarget< Real >::order_, ROL::MeanDeviationFromTarget< Real >::positiveFunction_, and ROL::MeanDeviationFromTarget< Real >::target_.

Member Function Documentation

template<class Real >
void ROL::MeanDeviationFromTarget< Real >::initializeMDT ( void  )
inlineprivate
template<class Real >
void ROL::MeanDeviationFromTarget< Real >::checkInputs ( void  )
inlineprivate
template<class Real >
void ROL::MeanDeviationFromTarget< Real >::initialize ( const Vector< Real > &  x)
inlinevirtual
template<class Real >
void ROL::MeanDeviationFromTarget< Real >::updateValue ( Objective< Real > &  obj,
const Vector< Real > &  x,
const std::vector< Real > &  xstat,
Real &  tol 
)
inlinevirtual

Update internal storage for value computation.

Parameters
[in]valis the value of the random variable objective function at the current sample point
[in]weightis the weight associated with the current sample point

Reimplemented from ROL::RandVarFunctional< Real >.

Definition at line 244 of file ROL_MeanDeviationFromTarget.hpp.

References ROL::RandVarFunctional< Real >::computeValue(), ROL::MeanDeviationFromTarget< Real >::NumMoments_, ROL::MeanDeviationFromTarget< Real >::order_, ROL::MeanDeviationFromTarget< Real >::positiveFunction_, ROL::MeanDeviationFromTarget< Real >::pval_, ROL::MeanDeviationFromTarget< Real >::target_, ROL::RandVarFunctional< Real >::val_, and ROL::RandVarFunctional< Real >::weight_.

template<class Real >
Real ROL::MeanDeviationFromTarget< Real >::getValue ( const Vector< Real > &  x,
const std::vector< Real > &  xstat,
SampleGenerator< Real > &  sampler 
)
inlinevirtual

Return risk measure value.

Parameters
[in]sampleris the ROL::SampleGenerator used to sample the objective function

Upon return, getValue returns \(\mathcal{R}(f(x_0))\) where \(f(x_0)\) denotes the random variable objective function evaluated at \(x_0\).

Reimplemented from ROL::RandVarFunctional< Real >.

Definition at line 258 of file ROL_MeanDeviationFromTarget.hpp.

References ROL::MeanDeviationFromTarget< Real >::coeff_, ROL::MeanDeviationFromTarget< Real >::NumMoments_, ROL::MeanDeviationFromTarget< Real >::order_, ROL::MeanDeviationFromTarget< Real >::pval_, ROL::SampleGenerator< Real >::sumAll(), and ROL::RandVarFunctional< Real >::val_.

template<class Real >
void ROL::MeanDeviationFromTarget< Real >::updateGradient ( Objective< Real > &  obj,
const Vector< Real > &  x,
const std::vector< Real > &  xstat,
Real &  tol 
)
inlinevirtual

Update internal risk measure storage for gradient computation.

Parameters
[in]valis the value of the random variable objective function at the current sample point
[in]gis the gradient of the random variable objective function at the current sample point
[in]weightis the weight associated with the current sample point

Reimplemented from ROL::RandVarFunctional< Real >.

Definition at line 272 of file ROL_MeanDeviationFromTarget.hpp.

References ROL::RandVarFunctional< Real >::computeGradient(), ROL::RandVarFunctional< Real >::computeValue(), ROL::RandVarFunctional< Real >::dualVector_, ROL::RandVarFunctional< Real >::g_, ROL::MeanDeviationFromTarget< Real >::NumMoments_, ROL::MeanDeviationFromTarget< Real >::order_, ROL::MeanDeviationFromTarget< Real >::pg_, ROL::MeanDeviationFromTarget< Real >::positiveFunction_, ROL::MeanDeviationFromTarget< Real >::pval_, ROL::MeanDeviationFromTarget< Real >::target_, and ROL::RandVarFunctional< Real >::weight_.

template<class Real >
void ROL::MeanDeviationFromTarget< Real >::getGradient ( Vector< Real > &  g,
std::vector< Real > &  gstat,
const Vector< Real > &  x,
const std::vector< Real > &  xstat,
SampleGenerator< Real > &  sampler 
)
inlinevirtual

Return risk measure (sub)gradient.

Parameters
[out]gis the (sub)gradient of the risk measure
[in]sampleris the ROL::SampleGenerator used to sample the objective function

Upon return, getGradient returns \(\theta\in\partial\mathcal{R}(f(x_0))\) where \(f(x_0)\) denotes the random variable objective function evaluated at \(x_0\) and \(\partial\mathcal{R}(X)\) denotes the subdifferential of \(\mathcal{R}\) at \(X\).

Reimplemented from ROL::RandVarFunctional< Real >.

Definition at line 290 of file ROL_MeanDeviationFromTarget.hpp.

References ROL::Vector< Real >::axpy(), ROL::MeanDeviationFromTarget< Real >::coeff_, ROL::RandVarFunctional< Real >::dualVector_, ROL::RandVarFunctional< Real >::g_, ROL::MeanDeviationFromTarget< Real >::NumMoments_, ROL::MeanDeviationFromTarget< Real >::order_, ROL::MeanDeviationFromTarget< Real >::pg_, ROL::MeanDeviationFromTarget< Real >::pval_, ROL::SampleGenerator< Real >::sumAll(), and zero.

template<class Real >
void ROL::MeanDeviationFromTarget< Real >::updateHessVec ( Objective< Real > &  obj,
const Vector< Real > &  v,
const std::vector< Real > &  vstat,
const Vector< Real > &  x,
const std::vector< Real > &  xstat,
Real &  tol 
)
inlinevirtual

Update internal risk measure storage for Hessian-time-a-vector computation.

Parameters
[in]valis the value of the random variable objective function at the current sample point
[in]gis the gradient of the random variable objective function at the current sample point
[in]gvis the gradient of the random variable objective function at the current sample point applied to the vector v0
[in]hvis the Hessian of the random variable objective function at the current sample point applied to the vector v0
[in]weightis the weight associated with the current sample point

Reimplemented from ROL::RandVarFunctional< Real >.

Definition at line 308 of file ROL_MeanDeviationFromTarget.hpp.

References ROL::RandVarFunctional< Real >::computeGradVec(), ROL::RandVarFunctional< Real >::computeHessVec(), ROL::RandVarFunctional< Real >::computeValue(), ROL::RandVarFunctional< Real >::dualVector_, ROL::RandVarFunctional< Real >::g_, ROL::RandVarFunctional< Real >::hv_, ROL::MeanDeviationFromTarget< Real >::NumMoments_, ROL::MeanDeviationFromTarget< Real >::order_, ROL::MeanDeviationFromTarget< Real >::pg0_, ROL::MeanDeviationFromTarget< Real >::pg_, ROL::MeanDeviationFromTarget< Real >::pgv_, ROL::MeanDeviationFromTarget< Real >::phv_, ROL::MeanDeviationFromTarget< Real >::positiveFunction_, ROL::MeanDeviationFromTarget< Real >::pval_, ROL::MeanDeviationFromTarget< Real >::target_, and ROL::RandVarFunctional< Real >::weight_.

template<class Real >
void ROL::MeanDeviationFromTarget< Real >::getHessVec ( Vector< Real > &  hv,
std::vector< Real > &  hvstat,
const Vector< Real > &  v,
const std::vector< Real > &  vstat,
const Vector< Real > &  x,
const std::vector< Real > &  xstat,
SampleGenerator< Real > &  sampler 
)
inlinevirtual

Return risk measure Hessian-times-a-vector.

Parameters
[out]hvis the Hessian-times-a-vector of the risk measure
[in]sampleris the ROL::SampleGenerator used to sample the objective function

Upon return, getHessVec returns \(\nabla^2 \mathcal{R}(f(x_0))v_0\) (if available) where \(f(x_0)\) denotes the random variable objective function evaluated at \(x_0\).

Reimplemented from ROL::RandVarFunctional< Real >.

Definition at line 339 of file ROL_MeanDeviationFromTarget.hpp.

References ROL::Vector< Real >::axpy(), ROL::MeanDeviationFromTarget< Real >::coeff_, ROL::RandVarFunctional< Real >::dualVector_, ROL::RandVarFunctional< Real >::hv_, ROL::MeanDeviationFromTarget< Real >::NumMoments_, ROL::MeanDeviationFromTarget< Real >::order_, ROL::MeanDeviationFromTarget< Real >::pg0_, ROL::MeanDeviationFromTarget< Real >::pg_, ROL::MeanDeviationFromTarget< Real >::pgv_, ROL::MeanDeviationFromTarget< Real >::phv_, ROL::MeanDeviationFromTarget< Real >::pval_, ROL::SampleGenerator< Real >::sumAll(), and zero.

Member Data Documentation

template<class Real >
Ptr<PositiveFunction<Real> > ROL::MeanDeviationFromTarget< Real >::positiveFunction_
private
template<class Real >
std::vector<Real> ROL::MeanDeviationFromTarget< Real >::target_
private
template<class Real >
std::vector<Real> ROL::MeanDeviationFromTarget< Real >::order_
private
template<class Real >
std::vector<Real> ROL::MeanDeviationFromTarget< Real >::coeff_
private
template<class Real >
uint ROL::MeanDeviationFromTarget< Real >::NumMoments_
private
template<class Real >
std::vector<Real> ROL::MeanDeviationFromTarget< Real >::pval_
private
template<class Real >
std::vector<Real> ROL::MeanDeviationFromTarget< Real >::pgv_
private
template<class Real >
std::vector<Ptr<Vector<Real> > > ROL::MeanDeviationFromTarget< Real >::pg0_
private
template<class Real >
std::vector<Ptr<Vector<Real> > > ROL::MeanDeviationFromTarget< Real >::pg_
private
template<class Real >
std::vector<Ptr<Vector<Real> > > ROL::MeanDeviationFromTarget< Real >::phv_
private
template<class Real >
bool ROL::MeanDeviationFromTarget< Real >::firstResetMDT_
private

The documentation for this class was generated from the following file: