Softmax
A function that turns a list of scores into probabilities that add up to one.
Exponentiating makes every score positive and exaggerates the largest; dividing by the sum normalises them. Softmax is the output layer of almost every multi-class classifier. Subtract the largest score before exponentiating to avoid overflow; the result is unchanged. Dividing scores by a temperature makes the distribution sharper or flatter.
See it in action
- Softmax (multinomial logistic) regressionLogistic regression for many classes: one linear score per class, normalised by the softmax.
- Neural networks and backpropagationMulti-layer perceptrons: learned features, activations, the chain rule, and training tricks.
- Policy gradients: REINFORCEOptimise the policy directly by gradient ascent on expected return, using the score-function trick.