jaxopt.projection.projection_halfspace

jaxopt.projection.projection_halfspace(x, hyperparams)[source]

Projection onto a halfspace:

\[\underset{y}{\text{argmin}} ~ ||x - y||_2^2 \quad \textrm{subject to} \quad a^\top y \le b\]
Parameters
  • x (Array) – pytree to project.

  • hyperparams (Tuple) – tuple hyperparams = (a, b), where a is a pytree with the same structure as x and b is a scalar.

Return type

Array

Returns

output array, with same shape as x.