pyproximal.projection.HalfSpaceProjยถ

class pyproximal.projection.HalfSpaceProj(w: ndarray[tuple[Any, ...], dtype[_ScalarT]], b: float)[source]ยถ

Half space projection.

Parameters:
wnumpy.ndarray

Coefficients of the half space

bfloat

bias of the half space

Notes

Given an half space defined as:

\[\operatorname{H}_{[w, b]} = \{ \mathbf{x}: \mathbf{w}^T \mathbf{x} \leq b \}\]

its orthogonal projection is:

\[\begin{split}P_{\operatorname{H}_{[w, b]}} (\mathbf{x}) = \begin{cases} \mathbf{x}, & \mathbf{w}^T \mathbf{x} \leq b \\ \mathbf{x} - \frac{\mathbf{w}^T \mathbf{x} - b}{||\mathbf{w}||^2} \mathbf{w}, & \text{otherwise} \end{cases}\end{split}\]

Note the this is the proximal operator of the corresponding indicator function \(\mathcal{I}_{\operatorname{H}_{[w, b]}}\).

Methods

__init__(w, b)