I'm going through Andrew Ng's lecture notes on Machine Learning and I just learnt about softmax regression there.

We see that, for softmax regression, the conditional distribution of $y$ given $x$ is given as:

This formula contains terms of form $e^{\theta^Tx}$. I was just wondering if there is an intuitive explanation for this? Or, why isn't the derived formula for probability simpler like:


And is there an intuitive explanation for what that would mean?


2 Answers 2


You need power to get rid of negative values. When you raise positive number to the power - you will always get positive value. For negative power - the result is just small and for positive - it's big and grows exponentially.

By using softmax you will never get negative probability nor probability higher then 1 and will never divide by zero when calculating it

$$\frac{ e^{\Theta_{i}^T x }}{ \sum_{j} e^{\Theta_{j}^T x } }$$

  • 1
    $\begingroup$ And why using e instead of arbitary number > 1? $\endgroup$
    – mrgloom
    Sep 1, 2017 at 15:42
  • 2
    $\begingroup$ It makes taking derivative simpler. $\endgroup$
    – Serhiy
    Sep 3, 2017 at 17:57

There is an intuitive definition. I tried to explain the softmax in this answer. To put it simply, you are interpreting the unbounded $\theta_i^Tx$ as log-odds, and the softmax converts them to probabilities in $[0,1]$. Your formula has no such interpretation.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.