TOPICS
Search

Softmax Function


The softmax function maps a real vector z in R^k to a vector of positive components that sum to 1. For 1<=i<=k, its components are

 softmax(z)_i=(e^(z_i))/(sum_(j=1)^(k)e^(z_j)).

Every component is positive and the components sum to 1. Adding the same constant to every component of z leaves the result unchanged. For k=2, the softmax function can be expressed using the sigmoid function. It is widely used to convert a collection of real-valued scores into probabilities for a categorical distribution.


See also

Exponential Function, Sigmoid Function

Explore with Wolfram|Alpha

References

Bishop, C. M. Pattern Recognition and Machine Learning. New York: Springer-Verlag, 2006.

Cite this as:

Weisstein, Eric W. "Softmax Function." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/SoftmaxFunction.html

Subject classifications