softmin

Contents

softmin#

class 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 (ArrayLike) – Input array of any shape.

  • axis (int, optional) – The axis along which Softmin will be computed. Every slice along this dimension will sum to 1. Default is -1.

Returns:

Output array with the same shape as the input.

Return type:

jax.Array or Quantity