TITLE: Invert the softmax function
QUESTION [24 upvotes]: Is it possible to revert the softmax function in order to obtain the original values $x_i$?
$$S_i=\frac{e^{x_i}}{\sum e^{x_i}} $$
In case of 3 input variables this problem boils down to finding $a$, $b$, $c$ given $x$, $y$ and $z$:
\begin{cases}
\frac{a}{a+b+c} &= x \\
\frac{b}{a+b+c} &= y \\
\frac{c}{a+b+c} &= z
\end{cases}
Is this problem solvable?

REPLY [13 votes]: A similar question was asked in a post of reddit. The answer below is adapted from that post:
$S_{i}$ = $\exp(x_{i})/(\sum_{i} \exp(x_{i}))$
Taking ln on both sides:
$\ln(S_{i}) = x_{i} - \ln(\sum_{i} \exp(x_{i}))$
Changing sides:
$x_{i} = \ln(S_{i}) + \ln(\sum_{i} \exp(x_{i}))$
The second term of the right hand side is constant for a particular $i$ and can be written as $C_{i}$. Therefore, we can write:
$x_{i} = \ln(S_{i}) + C$