brainstate.nn.softmin#
- brainstate.nn.softmin(x, axis=-1)[source]#
Softmin activation function.
Applies the Softmin function to an n-dimensional input tensor, rescaling elements so that they lie in the range [0, 1] and sum to 1 along the specified axis.
\[\text{Softmin}(x_{i}) = \frac{\exp(-x_i)}{\sum_j \exp(-x_j)}\]- Parameters:
x (
Array|ndarray|bool|number|bool|int|float|complex|Quantity) – Input array of any shape.axis (
int|tuple[int,...] |None) – The axis or axes along which Softmin will be computed. Every slice along these dimensions will sum to 1. Either an integer or a tuple of integers. Default is -1.
- Returns:
Output array with the same shape as the input.
- Return type:
Array|Quantity