jax.nn.softmax
Warning
This page was created from a pull request (#9655).
jax.nn.softmaxΒΆ
- jax.nn.softmax(x, axis=- 1, where=None, initial=None)[source]ΒΆ
Softmax function.
Computes the function which rescales elements to the range \([0, 1]\) such that the elements along
axissum to \(1\).\[\mathrm{softmax}(x) = \frac{\exp(x_i)}{\sum_j \exp(x_j)}\]- Parameters
x (
Any) β input arrayaxis (
Union[int,Tuple[int, β¦],None]) β the axis or axes along which the softmax should be computed. The softmax output summed across these dimensions should sum to \(1\). Either an integer or a tuple of integers.where (
Optional[Any]) β Elements to include in thesoftmax.initial (
Optional[Any]) β The minimum value used to shift the input array. Must be present whenwhereis not None.
- Return type