jaxopt.projection.projection_l1_ball

jaxopt.projection.projection_l1_ball(x, max_value=1.0)[source]

Projection onto the l1 ball:

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

  • max_value (float) – radius of the ball.

Return type

Array

Returns

output array, with the same structure as x.