jaxopt.projection.projection_box_section

jaxopt.projection.projection_box_section(x, hyperparams, check_feasible=False)[source]

Projection onto a box section:

\[\underset{p}{\text{argmin}} ~ ||x - p||_2^2 \quad \textrm{subject to} \quad \alpha \le p \le \beta, p^\top w = c\]

The problem is infeasible if \(w^\top \alpha > c\) or if \(w^\top \beta < c\).

Parameters
  • x (Array) – vector to project, an array of shape (n,).

  • hyperparams (Tuple) – tuple of parameters, hyperparams = (alpha, beta, w, c), where w, alpha and beta are of the same shape as x, and c is a scalar. Moreover, w should be positive.

  • check_feasible (bool) – whether to check feasibility or not. If True, function cannot be jitted.

Returns

projected vector, an array with the same shape as x.