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 (Teuchos::ParameterList &parlist)
 Constructor. More...
 
virtual Real Fprimal (Real x, int deriv=0)=0
 Implementation of the scalar primal F function. More...
 
virtual Real Fdual (Real x, int deriv=0)=0
 Implementation of the scalar dual F function. More...
 
void reset (Teuchos::RCP< Vector< Real > > &x0, const Vector< Real > &x)
 Reset internal risk measure storage. Called for value and gradient computation. More...
 
void reset (Teuchos::RCP< Vector< Real > > &x0, const Vector< Real > &x, Teuchos::RCP< Vector< Real > > &v0, const Vector< Real > &v)
 Reset internal risk measure storage. Called for Hessian-times-a-vector computation. More...
 
void update (const Real val, const Real weight)
 Update internal risk measure storage for value computation. More...
 
Real getValue (SampleGenerator< Real > &sampler)
 Return risk measure value. More...
 
void update (const Real val, const Vector< Real > &g, const Real weight)
 Update internal risk measure storage for gradient computation. More...
 
void getGradient (Vector< Real > &g, SampleGenerator< Real > &sampler)
 Return risk measure (sub)gradient. More...
 
void update (const Real val, const Vector< Real > &g, const Real gv, const Vector< Real > &hv, const Real weight)
 Update internal risk measure storage for Hessian-time-a-vector computation. More...
 
void getHessVec (Vector< Real > &hv, SampleGenerator< Real > &sampler)
 Return risk measure Hessian-times-a-vector. More...
 
- Public Member Functions inherited from ROL::RiskMeasure< Real >
virtual ~RiskMeasure ()
 
 RiskMeasure (void)
 

Private Member Functions

void checkInputs (void) const
 

Private Attributes

Real thresh_
 
Teuchos::RCP< Vector< Real > > dualVector_
 
Real xlam_
 
Real xmu_
 
Real vlam_
 
Real vmu_
 
Real valLam_
 
Real valLam2_
 
Real valMu_
 
Real valMu2_
 
bool firstReset_
 

Additional Inherited Members

- Protected Attributes inherited from ROL::RiskMeasure< Real >
Real val_
 
Real gv_
 
Teuchos::RCP< Vector< Real > > g_
 
Teuchos::RCP< Vector< Real > > hv_
 
Teuchos::RCP< Vector< Real > > dualVector_
 
bool firstReset_
 

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 88 of file ROL_FDivergence.hpp.

Constructor & Destructor Documentation

◆ FDivergence() [1/2]

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 118 of file ROL_FDivergence.hpp.

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

◆ FDivergence() [2/2]

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

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

Member Function Documentation

◆ checkInputs()

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

◆ Fprimal()

template<class Real >
virtual Real ROL::FDivergence< Real >::Fprimal ( Real  x,
int  deriv = 0 
)
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 >.

◆ Fdual()

template<class Real >
virtual Real ROL::FDivergence< Real >::Fdual ( Real  x,
int  deriv = 0 
)
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 >::update().

◆ reset() [1/2]

template<class Real >
void ROL::FDivergence< Real >::reset ( Teuchos::RCP< Vector< Real > > &  x0,
const Vector< Real > &  x 
)
inlinevirtual

Reset internal risk measure storage. Called for value and gradient computation.

Parameters
[out]x0is a user-provided optimization vector
[in]xis a (potentially) augmented risk vector
   On input, \form#56 carries \form#323 and any statistics (scalars)
   associated with the risk measure. 

Reimplemented from ROL::RiskMeasure< Real >.

Definition at line 164 of file ROL_FDivergence.hpp.

References ROL::FDivergence< Real >::dualVector_, ROL::FDivergence< Real >::firstReset_, ROL::RiskMeasure< Real >::reset(), ROL::FDivergence< Real >::valLam2_, ROL::FDivergence< Real >::valLam_, ROL::FDivergence< Real >::valMu2_, ROL::FDivergence< Real >::valMu_, ROL::FDivergence< Real >::xlam_, and ROL::FDivergence< Real >::xmu_.

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

◆ reset() [2/2]

template<class Real >
void ROL::FDivergence< Real >::reset ( Teuchos::RCP< Vector< Real > > &  x0,
const Vector< Real > &  x,
Teuchos::RCP< Vector< Real > > &  v0,
const Vector< Real > &  v 
)
inlinevirtual

Reset internal risk measure storage. Called for Hessian-times-a-vector computation.

Parameters
[out]x0is a user-provided optimization vector
[in]xis a (potentially) augmented risk vector
[out]v0is a user-provided direction vector
[in]vis a (potentially) augmented risk vector
   On input, \form#56 carries \form#323 and any statistics (scalars)
   associated with the risk measure.  Similarly, \form#37 carries
\(v_0\) and any statistics (scalars) associated with the risk measure.

Reimplemented from ROL::RiskMeasure< Real >.

Definition at line 176 of file ROL_FDivergence.hpp.

References ROL::FDivergence< Real >::reset(), ROL::FDivergence< Real >::vlam_, and ROL::FDivergence< Real >::vmu_.

◆ update() [1/3]

template<class Real >
void ROL::FDivergence< Real >::update ( const Real  val,
const Real  weight 
)
inlinevirtual

Update internal risk measure 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::RiskMeasure< Real >.

Definition at line 186 of file ROL_FDivergence.hpp.

References ROL::FDivergence< Real >::Fdual(), ROL::FDivergence< Real >::xlam_, and ROL::FDivergence< Real >::xmu_.

◆ getValue()

template<class Real >
Real ROL::FDivergence< Real >::getValue ( 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::RiskMeasure< Real >.

Definition at line 191 of file ROL_FDivergence.hpp.

References ROL::SampleGenerator< Real >::sumAll(), ROL::FDivergence< Real >::thresh_, ROL::FDivergence< Real >::xlam_, and ROL::FDivergence< Real >::xmu_.

◆ update() [2/3]

template<class Real >
void ROL::FDivergence< Real >::update ( const Real  val,
const Vector< Real > &  g,
const Real  weight 
)
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::RiskMeasure< Real >.

Definition at line 198 of file ROL_FDivergence.hpp.

References ROL::FDivergence< Real >::Fdual(), ROL::FDivergence< Real >::valLam_, ROL::FDivergence< Real >::valMu_, ROL::FDivergence< Real >::xlam_, and ROL::FDivergence< Real >::xmu_.

◆ getGradient()

template<class Real >
void ROL::FDivergence< Real >::getGradient ( Vector< Real > &  g,
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::RiskMeasure< Real >.

Definition at line 209 of file ROL_FDivergence.hpp.

References ROL::FDivergence< Real >::dualVector_, ROL::RiskVector< Real >::setStatistic(), ROL::RiskVector< Real >::setVector(), ROL::SampleGenerator< Real >::sumAll(), ROL::FDivergence< Real >::thresh_, ROL::FDivergence< Real >::valLam_, and ROL::FDivergence< Real >::valMu_.

◆ update() [3/3]

template<class Real >
void ROL::FDivergence< Real >::update ( const Real  val,
const Vector< Real > &  g,
const Real  gv,
const Vector< Real > &  hv,
const Real  weight 
)
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::RiskMeasure< Real >.

Definition at line 227 of file ROL_FDivergence.hpp.

References ROL::FDivergence< Real >::Fdual(), ROL::FDivergence< Real >::valLam2_, ROL::FDivergence< Real >::valLam_, ROL::FDivergence< Real >::valMu2_, ROL::FDivergence< Real >::valMu_, ROL::FDivergence< Real >::vlam_, ROL::FDivergence< Real >::vmu_, ROL::FDivergence< Real >::xlam_, and ROL::FDivergence< Real >::xmu_.

◆ getHessVec()

template<class Real >
void ROL::FDivergence< Real >::getHessVec ( Vector< Real > &  hv,
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::RiskMeasure< Real >.

Definition at line 240 of file ROL_FDivergence.hpp.

References ROL::FDivergence< Real >::dualVector_, ROL::RiskVector< Real >::setStatistic(), ROL::RiskVector< Real >::setVector(), ROL::SampleGenerator< Real >::sumAll(), ROL::FDivergence< Real >::valLam2_, ROL::FDivergence< Real >::valLam_, ROL::FDivergence< Real >::valMu2_, ROL::FDivergence< Real >::valMu_, ROL::FDivergence< Real >::vlam_, ROL::FDivergence< Real >::vmu_, and ROL::FDivergence< Real >::xlam_.

Member Data Documentation

◆ thresh_

template<class Real >
Real ROL::FDivergence< Real >::thresh_
private

◆ dualVector_

template<class Real >
Teuchos::RCP<Vector<Real> > ROL::FDivergence< Real >::dualVector_
private

◆ xlam_

template<class Real >
Real ROL::FDivergence< Real >::xlam_
private

◆ xmu_

template<class Real >
Real ROL::FDivergence< Real >::xmu_
private

◆ vlam_

template<class Real >
Real ROL::FDivergence< Real >::vlam_
private

◆ vmu_

template<class Real >
Real ROL::FDivergence< Real >::vmu_
private

◆ valLam_

template<class Real >
Real ROL::FDivergence< Real >::valLam_
private

◆ valLam2_

template<class Real >
Real ROL::FDivergence< Real >::valLam2_
private

◆ valMu_

template<class Real >
Real ROL::FDivergence< Real >::valMu_
private

◆ valMu2_

template<class Real >
Real ROL::FDivergence< Real >::valMu2_
private

◆ firstReset_

template<class Real >
bool ROL::FDivergence< Real >::firstReset_
private

Definition at line 105 of file ROL_FDivergence.hpp.

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


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