tfmri.math.indicator_ball
tfmri.math.indicator_ball¶
- indicator_ball(x, order=2, radius=1.0, name=None)[source]¶
Indicator function of the Lp ball.
Returns
0
ifx
is in the Lp ball,inf
otherwise.The \(L_p\) ball of radius \(r\) is defined as the set of points of \({R}^{n}\) whose distance from the origin, as defined by the \(L_p\) norm, is less than or equal to \(r\).
\[\mathcal{B}_r = \left\{x \in \mathbb{R}^{n} : \left\|x\right\|_{p} \leq r \right\}\]If \(r\) is 1, this ball is also called the unit ball of the :math``L_p`` norm.
- Parameters
- Returns
A tf.Tensor of shape
[...]
and dtype equal tox.dtype.real_dtype
.- Raises
ValueError – If inputs are invalid.