ray.rllib.utils.numpy.softmax(x: Union[numpy.ndarray, list], axis: int = - 1, epsilon: Optional[float] = None) numpy.ndarray[source]#

Returns the softmax values for x.

The exact formula used is: S(xi) = e^xi / SUMj(e^xj), where j goes over all elements in x.

  • x – The input to the softmax function.

  • axis – The axis along which to softmax.

  • epsilon – Optional epsilon as a minimum value. If None, use SMALL_NUMBER.


The softmax over x.