optax.projections.projection_l1_sphere#
- optax.projections.projection_l1_sphere(tree: Any, scale: jax.typing.ArrayLike = 1) Any[source]#
Projection onto the l1 sphere.
This function solves the following constrained optimization problem, where
xis the input tree.\[\underset{y}{\text{argmin}} ~ \|x - y\|_2^2 \quad \textrm{subject to} \quad \|y\|_1 = \text{scale}\]- Parameters:
tree โ tree to project.
scale โ radius of the sphere.
- Returns:
projected tree, with the same structure as
tree.