tfmri.math.indicator_simplex
tfmri.math.indicator_simplex¶
- indicator_simplex(x, radius=1.0, name=None)[source]¶
Indicator function of the simplex.
Returns
0
ifx
is in the simplex,inf
otherwise.The simplex of radius \(r\) is defined as the set of points of \(\mathbb{R}^{n}\) whose elements are nonnegative and sum up to
r
.\[\Delta_r = \left\{x \in \mathbb{R}^{n} : \sum_{i=1}^{n} x_i = r \text{ and } x_i >= 0, \forall i = 1, \dots, n \right\}\]If \(r\) is 1, the simplex is also called the unit simplex, standard simplex or probability simplex.
- Parameters
- Returns
A tf.Tensor of shape
[...]
and dtype equal tox.dtype.real_dtype
.- Raises
ValueError – If inputs are invalid.