ROL
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ROL::FDivergence< Real > Class Template Referenceabstract

Provides a general interface for the F-divergence distributionally robust expectation. More...

#include <ROL_FDivergence.hpp>

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

Public Member Functions

 FDivergence (const Real thresh)
 Constructor. More...
 
 FDivergence (ROL::ParameterList &parlist)
 Constructor. More...
 
virtual Real Fprimal (Real x, int deriv=0) const =0
 Implementation of the scalar primal F function. More...
 
virtual Real Fdual (Real x, int deriv=0) const =0
 Implementation of the scalar dual F function. More...
 
bool check (std::ostream &outStream=std::cout) const
 
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< ScalarController< Real >> &value_storage, const Ptr< VectorController< Real >> &gradient_storage)
 
virtual void setHessVecStorage (const Ptr< ScalarController< Real >> &gradvec_storage, const Ptr< VectorController< Real >> &hessvec_storage)
 
virtual void resetStorage (bool flag=true)
 Reset internal storage. More...
 
virtual void resetStorage (UpdateType type)
 
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 Member Functions

void checkInputs (void) const
 

Private Attributes

Real thresh_
 
Real valLam_
 
Real valLam2_
 
Real valMu_
 
Real valMu2_
 

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::FDivergence< Real >

Provides a general interface for the F-divergence distributionally robust expectation.

This class defines a risk measure \(\mathcal{R}\) which arises in distributionally robust stochastic programming. \(\mathcal{R}\) is given by

\[ \mathcal{R}(X) = \sup_{\vartheta\in\mathfrak{A}} \mathbb{E}[\vartheta X] \]

where \(\mathfrak{A}\) is called the ambiguity (or uncertainty) set and is defined by a constraint on the F-divergence, i.e.,

\[ \mathfrak{A} = \{\vartheta\in\mathcal{X}^*\,:\, \mathbb{E}[\vartheta] = 1,\; \vartheta \ge 0,\;\text{and}\; \mathbb{E}[F(\vartheta)] \le \epsilon\} \]

where \(F:\mathbb{R}\to[0,\infty]\) convex, lower semicontinuous and satisfies \(F(1) = 1\) and \(F(x) = \infty\) for \(x < 0\). \(\mathcal{R}\) is a law-invariant, coherent risk measure. Moreover, by a duality argument, \(\mathcal{R}\) can be reformulated as

\[ \mathcal{R}(X) = \inf_{\lambda > 0,\,\mu}\left\{ \lambda \epsilon + \mu + \mathbb{E}\left[ (\lambda F)^*(X-\mu)\right]\right\}. \]

Here, \((\lambda F)^*\) denotes the Legendre-Fenchel transformation of \((\lambda F)\). ROL implements this by augmenting the optimization vector \(x_0\) with the parameter \((\lambda,\mu)\), then minimizes jointly for \((x_0,\lambda,\mu)\).

Definition at line 53 of file ROL_FDivergence.hpp.

Constructor & Destructor Documentation

template<class Real >
ROL::FDivergence< Real >::FDivergence ( const Real  thresh)
inline

Constructor.

Parameters
[in]epsis the tolerance for the F-divergence constraint

Definition at line 87 of file ROL_FDivergence.hpp.

References ROL::FDivergence< Real >::checkInputs().

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

Constructor.

Parameters
[in]parlistis a parameter list specifying inputs

parlist should contain sublists "SOL"->"Risk Measure"->"F-Divergence" and within the "F-Divergence" sublist should have the following parameters

  • "Threshold" (greater than 0)

Definition at line 100 of file ROL_FDivergence.hpp.

References ROL::FDivergence< Real >::checkInputs(), and ROL::FDivergence< Real >::thresh_.

Member Function Documentation

template<class Real >
void ROL::FDivergence< Real >::checkInputs ( void  ) const
inlineprivate

Definition at line 76 of file ROL_FDivergence.hpp.

References ROL::FDivergence< Real >::thresh_, and zero.

Referenced by ROL::FDivergence< Real >::FDivergence().

template<class Real >
virtual Real ROL::FDivergence< Real >::Fprimal ( Real  x,
int  deriv = 0 
) const
pure virtual

Implementation of the scalar primal F function.

Parameters
[in]xis a scalar input
[in]derivis the derivative order

Upon return, Fprimal returns \(F(x)\) or a derivative of \(F(x)\).

Implemented in ROL::Chi2Divergence< Real >.

Referenced by ROL::FDivergence< Real >::check().

template<class Real >
virtual Real ROL::FDivergence< Real >::Fdual ( Real  x,
int  deriv = 0 
) const
pure virtual

Implementation of the scalar dual F function.

Parameters
[in]xis a scalar input
[in]derivis the derivative order

Upon return, Fdual returns \(F^*(x)\) or a derivative of \(F^*(x)\). Here, \(F^*\) denotes the Legendre-Fenchel transformation of \(F\), i.e.,

\[ F^*(y) = \sup_{x\in\mathbb{R}}\{xy - F(x)\}. \]

Implemented in ROL::Chi2Divergence< Real >.

Referenced by ROL::FDivergence< Real >::check(), ROL::FDivergence< Real >::updateGradient(), ROL::FDivergence< Real >::updateHessVec(), and ROL::FDivergence< Real >::updateValue().

template<class Real >
bool ROL::FDivergence< Real >::check ( std::ostream &  outStream = std::cout) const
inline
template<class Real >
void ROL::FDivergence< Real >::initialize ( const Vector< Real > &  x)
inlinevirtual

Initialize temporary variables.

Parameters
[in]xis a vector used for initializing storage

Reimplemented from ROL::RandVarFunctional< Real >.

Definition at line 174 of file ROL_FDivergence.hpp.

References ROL::RandVarFunctional< Real >::initialize(), ROL::FDivergence< Real >::valLam2_, ROL::FDivergence< Real >::valLam_, ROL::FDivergence< Real >::valMu2_, and ROL::FDivergence< Real >::valMu_.

template<class Real >
void ROL::FDivergence< 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 180 of file ROL_FDivergence.hpp.

References ROL::RandVarFunctional< Real >::computeValue(), ROL::FDivergence< Real >::Fdual(), ROL::RandVarFunctional< Real >::val_, and ROL::RandVarFunctional< Real >::weight_.

template<class Real >
Real ROL::FDivergence< 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 191 of file ROL_FDivergence.hpp.

References ROL::SampleGenerator< Real >::sumAll(), ROL::FDivergence< Real >::thresh_, and ROL::RandVarFunctional< Real >::val_.

template<class Real >
void ROL::FDivergence< 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 202 of file ROL_FDivergence.hpp.

References ROL::RandVarFunctional< Real >::computeGradient(), ROL::RandVarFunctional< Real >::computeValue(), ROL::RandVarFunctional< Real >::dualVector_, ROL::FDivergence< Real >::Fdual(), ROL::RandVarFunctional< Real >::g_, ROL::RandVarFunctional< Real >::val_, ROL::FDivergence< Real >::valLam_, ROL::FDivergence< Real >::valMu_, and ROL::RandVarFunctional< Real >::weight_.

template<class Real >
void ROL::FDivergence< 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 223 of file ROL_FDivergence.hpp.

References ROL::RandVarFunctional< Real >::g_, ROL::SampleGenerator< Real >::sumAll(), ROL::FDivergence< Real >::thresh_, ROL::RandVarFunctional< Real >::val_, ROL::FDivergence< Real >::valLam_, and ROL::FDivergence< Real >::valMu_.

template<class Real >
void ROL::FDivergence< 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 240 of file ROL_FDivergence.hpp.

References ROL::RandVarFunctional< Real >::computeGradVec(), ROL::RandVarFunctional< Real >::computeHessVec(), ROL::RandVarFunctional< Real >::computeValue(), ROL::RandVarFunctional< Real >::dualVector_, ROL::FDivergence< Real >::Fdual(), ROL::RandVarFunctional< Real >::hv_, ROL::RandVarFunctional< Real >::val_, ROL::FDivergence< Real >::valLam2_, ROL::FDivergence< Real >::valLam_, ROL::FDivergence< Real >::valMu2_, ROL::FDivergence< Real >::valMu_, and ROL::RandVarFunctional< Real >::weight_.

template<class Real >
void ROL::FDivergence< 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 268 of file ROL_FDivergence.hpp.

References ROL::RandVarFunctional< Real >::hv_, ROL::SampleGenerator< Real >::sumAll(), ROL::RandVarFunctional< Real >::val_, ROL::FDivergence< Real >::valLam2_, ROL::FDivergence< Real >::valLam_, ROL::FDivergence< Real >::valMu2_, and ROL::FDivergence< Real >::valMu_.

Member Data Documentation

template<class Real >
Real ROL::FDivergence< Real >::thresh_
private
template<class Real >
Real ROL::FDivergence< Real >::valLam_
private
template<class Real >
Real ROL::FDivergence< Real >::valLam2_
private
template<class Real >
Real ROL::FDivergence< Real >::valMu_
private
template<class Real >
Real ROL::FDivergence< Real >::valMu2_
private

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