jax.nn.log_softmax#
- jax.nn.log_softmax(x, axis=-1, where=None, initial=None)[source]#
Log-Softmax function.
Computes the logarithm of the
softmax
function, which rescales elements to the range \([-\infty, 0)\).\[\mathrm{log\_softmax}(x) = \log \left( \frac{\exp(x_i)}{\sum_j \exp(x_j)} \right)\]- Parameters:
x (
Any
) – input arrayaxis (
Union
[int
,Tuple
[int
,...
],None
]) – the axis or axes along which thelog_softmax
should be computed. Either an integer or a tuple of integers.where (
Optional
[Any
]) – Elements to include in thelog_softmax
.initial (
Optional
[Any
]) – The minimum value used to shift the input array. Must be present whenwhere
is not None.
- Return type: