pyproximal.projection.HalfSpaceProj#
- class pyproximal.projection.HalfSpaceProj(w: ndarray[tuple[Any, ...], dtype[_ScalarT]], b: float)[source]#
Half space projection.
- Parameters
- w
numpy.ndarray Coefficients of the half space
- b
float bias of the half space
- w
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)