nn.softmax_zero
Applies the Softmax zero function to an n-dimensional input Tensor rescaling them so that the elements of the n-dimensional output Tensor lie in the range [0,1] and sum to 1 while keeping the zero elements to zero.
The softmax zero on the set $\mathbf{x} = (x_1, ..., x_n)$ is given by :
where $S$ in a subset of $\mathbf{x}$ given by
Args
tensor
(@Tensor<T>
) - The input tensor.axis
(usize
) - The axis along which to compute the softmax zero.
Returns
A Tensor of fixed point numbers with the same shape than the input Tensor.
Type Constraints
Constrain input and output types to fixed point tensors.
Examples
Last updated