3
$\begingroup$

I was looking at logistic regression and softmax regression.

Based on this formula,

$P(y=j|\mathbf {x} )={\frac {e^{\mathbf {x} ^{\mathsf {T}}\mathbf {w} _{j}}}{\sum _{k=1}^{K}e^{\mathbf {x} ^{\mathsf {T}}\mathbf {w} _{k}}}}$

How does $k=2$ make it logistic regression? I cannot seem to derive this to this

$\sigma (t)={\frac {e^{t}}{e^{t}+1}}={\frac {1}{1+e^{-t}}}$

$\endgroup$
1

1 Answer 1

1
$\begingroup$

The soft-max function is a function with potentially a multi-dimensional input $x$ and potentially multiple outputs, indexed by $j$. The sigmoid function is in principle a 1-dimensional function with a single output. After setting $k=2$, we still need to reconcile those facts. One way to do that is the following way:

Suppose:
$x(t)=t $
$w=\binom{0}{1}$
Then indeed we have:
$P(y=1|x(t))=\frac{e^{x^T w_1}}{\sum_{k=1}^{2}{e^{x^T w_k}}}=\frac{e^{t\cdot 1}}{e^{t \cdot0}+e^{t \cdot1}}=\frac{e^{t}}{1+e^{t}}=\sigma(t)$

$\endgroup$
1
  • $\begingroup$ that 1/(1+exp(-t)) is sigmoid, how about the generalised logistic function: en.wikipedia.org/wiki/Logistic_function is it still a special case of softmax? $\endgroup$
    – Dan D.
    Commented Oct 16, 2019 at 8:08

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