AIExplainer

What is a softmax?

A function that determines probabilities for each possible class in a multi-class classification model.

A function that determines probabilities for each possible class in a multi-class classification model. The probabilities add up to exactly 1.0. For example, the following table shows how softmax distributes various probabilities:

Softmax is also called full softmax. Contrast with candidate sampling.

where: - $\sigma_i$ is the output vector. Each element of the output vector specifies the probability of this element. The sum of all the elements in the output vector is 1.0. The output vector contains the same number of elements as the input vector, $z$. - $z$ is the input vector. Each element of the input vector contains a floating-point value. - $K$ is the number of elements in the input vector (and the output vector). For example, suppose the input vector is:

Therefore, softmax calculates the denominator as follows:

The softmax probability of each element is therefore: So, the output vector is therefore: