ROL
|
Provides a general interface for the F-divergence distributionally robust expectation. More...
#include <ROL_FDivergence.hpp>
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_ |
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.
|
inline |
Constructor.
[in] | eps | is the tolerance for the F-divergence constraint |
Definition at line 87 of file ROL_FDivergence.hpp.
References ROL::FDivergence< Real >::checkInputs().
|
inline |
Constructor.
[in] | parlist | is 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
Definition at line 100 of file ROL_FDivergence.hpp.
References ROL::FDivergence< Real >::checkInputs(), and ROL::FDivergence< Real >::thresh_.
|
inlineprivate |
Definition at line 76 of file ROL_FDivergence.hpp.
References ROL::FDivergence< Real >::thresh_, and zero.
Referenced by ROL::FDivergence< Real >::FDivergence().
|
pure virtual |
Implementation of the scalar primal F function.
[in] | x | is a scalar input |
[in] | deriv | is 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().
|
pure virtual |
Implementation of the scalar dual F function.
[in] | x | is a scalar input |
[in] | deriv | is 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().
|
inline |
Definition at line 131 of file ROL_FDivergence.hpp.
References ROL::FDivergence< Real >::Fdual(), and ROL::FDivergence< Real >::Fprimal().
|
inlinevirtual |
Initialize temporary variables.
[in] | x | is 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_.
|
inlinevirtual |
Update internal storage for value computation.
[in] | val | is the value of the random variable objective function at the current sample point |
[in] | weight | is 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_.
|
inlinevirtual |
Return risk measure value.
[in] | sampler | is 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_.
|
inlinevirtual |
Update internal risk measure storage for gradient computation.
[in] | val | is the value of the random variable objective function at the current sample point |
[in] | g | is the gradient of the random variable objective function at the current sample point |
[in] | weight | is 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_.
|
inlinevirtual |
Return risk measure (sub)gradient.
[out] | g | is the (sub)gradient of the risk measure |
[in] | sampler | is 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_.
|
inlinevirtual |
Update internal risk measure storage for Hessian-time-a-vector computation.
[in] | val | is the value of the random variable objective function at the current sample point |
[in] | g | is the gradient of the random variable objective function at the current sample point |
[in] | gv | is the gradient of the random variable objective function at the current sample point applied to the vector v0 |
[in] | hv | is the Hessian of the random variable objective function at the current sample point applied to the vector v0 |
[in] | weight | is 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_.
|
inlinevirtual |
Return risk measure Hessian-times-a-vector.
[out] | hv | is the Hessian-times-a-vector of the risk measure |
[in] | sampler | is 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_.
|
private |
Definition at line 55 of file ROL_FDivergence.hpp.
Referenced by ROL::FDivergence< Real >::checkInputs(), ROL::FDivergence< Real >::FDivergence(), ROL::FDivergence< Real >::getGradient(), and ROL::FDivergence< Real >::getValue().
|
private |
Definition at line 57 of file ROL_FDivergence.hpp.
Referenced by ROL::FDivergence< Real >::getGradient(), ROL::FDivergence< Real >::getHessVec(), ROL::FDivergence< Real >::initialize(), ROL::FDivergence< Real >::updateGradient(), and ROL::FDivergence< Real >::updateHessVec().
|
private |
Definition at line 58 of file ROL_FDivergence.hpp.
Referenced by ROL::FDivergence< Real >::getHessVec(), ROL::FDivergence< Real >::initialize(), and ROL::FDivergence< Real >::updateHessVec().
|
private |
Definition at line 59 of file ROL_FDivergence.hpp.
Referenced by ROL::FDivergence< Real >::getGradient(), ROL::FDivergence< Real >::getHessVec(), ROL::FDivergence< Real >::initialize(), ROL::FDivergence< Real >::updateGradient(), and ROL::FDivergence< Real >::updateHessVec().
|
private |
Definition at line 60 of file ROL_FDivergence.hpp.
Referenced by ROL::FDivergence< Real >::getHessVec(), ROL::FDivergence< Real >::initialize(), and ROL::FDivergence< Real >::updateHessVec().