# Smooth approximation of maximum using softmax?

Look at the Wiki page for Softmax function (section "Smooth approximation of maximum"): https://en.wikipedia.org/wiki/Softmax_function

It is saying that the following is a smooth approximation to the softmax: $$\mathcal{S}_{\alpha}\left(\left\{x_i\right\}_{i=1}^{n}\right) = \frac{\sum_{i=1}^{n}x_i e^{\alpha x_i}}{\sum_{i=1}^{n}e^{\alpha x_i}}$$

• Is it an approximation to the Softmax?

• If so, Softmax is already smooth; why do we create another smooth approximation?

• If so, how do derive it from Softmax?

• I don't see why this might be better than Softmax for gradien descent updates.

• I am confused by this as well, but let me make a comment that might be useful. A smooth approximation of maximum that I am familiar with is $f(x,\alpha):=\alpha^{-1} \log\left(\sum_i e^{\alpha x_i}\right)$ which is always within an additive $(\log n)/\alpha$ from the maximum. The function in your question is $\partial f/\partial\alpha$. May 18, 2015 at 4:46
• Out of curiosity, what problem are you solving? Are you sure you can't just use the max function? Many convex optimization algorithms can handle nondifferentiable objective functions. Jul 18, 2015 at 5:13

This is a smooth approximation of maximum function:

$$\max\{x_1,\dots, x_n\}$$

where $\alpha$ controls the "softness" of the maximum. The detailed explanation is available here: http://www.johndcook.com/blog/2010/01/13/soft-maximum/

Softmax is better then maximum, because it is smooth function, while $\max$ is not smooth and does not always have a gradient.

• Could you perhaps sum up the detailed discussion in your answer? Sep 24, 2014 at 22:21
• The sum up is the first sentence of my reply, in the explanation there are also visual examples given. Sep 25, 2014 at 23:26
• to be short, $\alpha \to +\infty$ makes softmax converge to max, and $\alpha \to -\infty$ makes softmax converge to min Sep 26, 2014 at 2:53
• The blog entry discusses a different function from the one in the question. May 18, 2015 at 4:42
• yes, the function described there is a little different (it is numerically better I think, this is the one you've mentioned), but the idea is the same. Both are valid approximations. May 21, 2015 at 8:10