Function burn::tensor::activation::quiet_softmax
pub fn quiet_softmax<const D: usize, B>(
tensor: Tensor<B, D>,
dim: usize,
) -> Tensor<B, D>where
B: Backend,
Expand description
Applies the “quiet softmax” function on the input tensor along the given dimension. This function is similar to the softmax function, but it allows for “no selection”, e.g., all outputs can tend to zero.
softmax(x_i) = exp(x_i) / [ 1 + sum_j(exp(x_j)) ]
§Notes
The dimension argument dim
specifies the dimension along which the function will be computed.
It must in the range of 0
and D-1
.