EqualizedOptimizable¶
-
class
EqualizedOptimizable(problem, coeffs_z=None)¶ -
An Optimizable object automatically converts all inequality constraints into equality constraints with the method of slack variables.
Usage
pythonequalizedProblem = EqualizedOptimizable(problem)Supposing that
problemcorresponds to the optimization problem\[\begin{aligned} \min_{x\in \mathcal{X}}& \quad J(x)\\ \textrm{s.t.} & \left\{\begin{aligned} g_i(x)&=0, \text{ for all } 1\leqslant i\leqslant p,\\ h_j(x) &\leqslant 0 \text{ for all }1\leqslant j \leqslant q,\\ \end{aligned}\right. \end{aligned}\]the
equalizedProblemcorresponds to the equalized program\[\begin{aligned} \min_{x\in \mathcal{X}}& \quad J(x)\\ \textrm{s.t.} & \left\{\begin{aligned} g_i(x)&=0, \text{ for all } 1\leqslant i\leqslant p,\\ h_j(x)+\frac{1}{2}z_j^2 &= 0 \text{ for all }1\leqslant j \leqslant q,\\ \end{aligned}\right. \end{aligned}\]Optimization points for the
EqualizedOptimizableobject are tuples of the form(x,z)withxan optimization point for problem andza list of size \(q\) the number of inequality constraints.The initial value for the slack variable is set to
\[z_j(0) = \sqrt{2 |h_i(x(0))|} \text{ for } 1\leqslant j \leqslant q\]The inner product chosen on the z variable is the usual Euclidean inner product. Derivatives with respect to the z variable are appended at the end of the derivative arrays with respect to x.
Note
In practice, the equalization helps to find a central path going from the initialization to the optimum in between the constraints. However, equalization can be inefficient or require some tuning for problems with a large number of constraints.
- Problem:
An instance of
Optimizableimplementing an arbitrary optimization program.- Parameters:
coeffs_z – some coefficients to equalize \(h_j(x)\leqslant 0\) into \(h_j(x)+\frac{1}{2}\texttt{coeffs\_z}[j] z_j^2=0\).