Skip to content
ML Academy

Introduced on day 32

Softmax

A function that maps K logits to K positive probabilities summing to 1 by exponentiating and normalizing; the output layer for one-of-K classification.

In detail

pk=ezk/∑jezjp_k = e^{z_k} / \sum_j e^{z_j}. Adding the same constant to every logit leaves it unchanged, so stable implementations subtract the maximum first. Softmax outputs compete, so it fits mutually exclusive classes; for labels that can co-occur use independent sigmoids. Its probabilities are not guaranteed to be calibrated.