pymoose.softmax
pymoose.softmax#
- pymoose.softmax(x, axis, upmost_index, placement=None)[source]#
Softmax function.
\[\mathrm{softmax}(x) = \frac{\exp(x_i)}{\sum_j \exp(x_j)}\]- Parameters
x – A tensor.
axis – The dimension along which the softmax divisor’s sum-reduce should be computed.
upmost_index – The max index that should be used for computing the softmax divisor’s sum-reduce. Generally, this should be the size of the
axisdimension ofx.placement – An optional
Placementto pin this operation to.
- Returns
Result of applying the softmax function on
xalong the givenaxis.