Machine Learning & AI
Basic

Softmax

Turns a vector of scores into a probability distribution that sums to 1.

Formula

σ(z)i=ezijezj\sigma(z)_i = \dfrac{e^{z_i}}{\sum_{j} e^{z_j}}

Variables

z_iScore for class i
jAll classes

Example

z=[1,2,3]: softmax=[0.09,0.24,0.67]

Did You Know?

Softmax is the standard output layer for multi-class classifiers, from digit recognition to LLMs.

Share this formula