The Oracles

We propose two classes for the computation of the first order oracle associated to our DC formulation. Both oracles take as an input an instance of Problem and a few paramters such as the safety probability threshold.

The classes differ in that the second one support numba-compliant problem classes. Given the numba option provided when instantiating an Optimizer, first or second class will be instantiated for solving.

class taco.Oracle(problem, p, pen1, pen2, rho)[source]

Base class that instantiates a first-order oracle for the DC objective of the penalized chance constaint

For two input oracles \(f\) and \(g\) given through their function and gradients, and a sampled dataset from a random variable \(\xi\), this class is an interface to compute the value and the gradient of the function \(x, \eta \mapsto f(x) + \mu \max(\eta,0) + \lambda \left(G(x,\eta) - \text{CVaR}_p(g(x,\xi))\right)\) where \(G(x, \eta) = \eta + \frac{1}{1-p} \mathbb{E}[\max(g(x, \xi) - \eta]\)

Parameters
  • problem – Instance of Problem

  • p (np.float64) – Real number in [0,1]. Safety probability level

  • pen1 (np.float64) – Penalization parameter, must be positive.

  • pen2 (np.float64) – Penalization parameter, must be positive.

  • rho (np.float64) – Smoothing parameter for the superquantile, must be positive.

f(x)[source]

Value of the DC objective

f1(x)[source]

Value of the convex part of the DC objective \(x, \eta \mapsto f(x) + \mu \max(\eta,0) + \lambda G(x,\eta)\)

f2(x)[source]

Value of the concave part of the DC objective \(x, \eta \mapsto - {CVaR}_p(g(x,{\xi}))\)

g1(x)[source]

Gradient of the convex part of the DC objective \(x, \eta \mapsto f(x) + \mu \max(\eta,0) + \lambda G(x,\eta)\)

g2(x)[source]

Gradient of the concave part of the DC objective \(x, \eta \mapsto - {CVaR}_p(g(x,{\xi}))\)

class taco.FastOracle(*args, **kwargs)

Numba version of the class Oracle.

FastOracle works with numba in full no-python mode. It must take as an input an instance of problem that is a jitclass.

Parameters
  • problem – Instance of Problem. Must be a numba jitclass.

  • p (np.float64) – Real number in [0,1]. Safety probability level

  • pen1 (np.float64) – Penalization parameter, must be positive.

  • pen2 (np.float64) – Penalization parameter, must be positive.

  • rho (np.float64) – Smoothing parameter for the superquantile, must be positive.