Write out the softmax function and its main property.
easyAnswer
- .
- It maps a vector of real logits to a probability distribution: values in (0, 1) that sum to 1.
- It's invariant to adding a constant to all logits (that's why we subtract max(z) for numerical stability).
- The winner is the argmax; adjacent logits produce similar probabilities so the mapping is smooth and differentiable — perfect for gradient descent.
Check yourself — multiple choice
- Softmax sums to zero
- ; it maps logits to a probability distribution
- Softmax always outputs one-hot vectors
- Softmax is not differentiable
softmax = normalized exponentials; smooth, differentiable, sums to 1.
#logistic-regression#classification
Practise Supervised Learning
215 interview questions in this topic.
Related questions
- Why do we use cross-entropy (log loss) instead of MSE for classification?
- One-vs-Rest, One-vs-One, and softmax — how do you choose for multi-class?
- 'multinomial' vs 'ovr' setting in scikit-learn's LogisticRegression — what changes?
- When would LDA outperform logistic regression?
- Precision vs recall — when do you optimize each?
- Why is logistic regression called a linear model if it uses a sigmoid?