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
) – tuplehyperparams = (a, b)
, wherea
is a pytree with the same structure asx
andb
is a scalar.
- Return type
Array
- Returns
output array, with same shape as
x
.