2

http://www.ai.mit.edu/courses/6.892/lecture8-html/sld015.htm

how does this:

$${1\over 1 + e^{-x}} \cdot {-e^{-x}\over 1 + e^{-x}}$$

become this:

$${1\over 1 + e^{-x}} \cdot \left (1 - {1\over 1 + e^{-x}}\right)$$

2 Answers2

1

I checked again and it is wrong. If the minus sign for the $-e^{-x}$ wasn't there then it would be right.

0

From the link, it appears they are trying to show $$ \begin{align} \frac{\mathrm{d}}{\mathrm{d}x}\frac1{1+e^{-x}} &=\frac{-1}{(1+e^{-x})^2}\frac{\mathrm{d}}{\mathrm{d}x}e^{-x}\tag{1}\\ &=\frac{-1}{(1+e^{-x})^2}(-e^{-x})\tag{2}\\ &=\frac1{1+e^{-x}}\frac{e^{-x}}{1+e^{-x}}\tag{3}\\ &=\frac1{1+e^{-x}}\left(1-\frac1{1+e^{-x}}\right)\tag{4} \end{align} $$ So the equation would be $$ \frac1{1+e^{-x}}\frac{e^{-x}}{1+e^{-x}} =\frac1{1+e^{-x}}\left(1-\frac1{1+e^{-x}}\right)\tag{5} $$ Note that in step $(3)$ the two negatives cancel.

robjohn
  • 345,667
  • that is the derivative of the sigmoid function though ie g'(x) = g(x) * (1 - g(x)) .I had tried doing it using the chain rule and got -e^-x / (1 + e^-x) ^ 2 which when can become the first equation in my question. At that point i get stuck – user3234550 Jan 22 '15 at 20:02
  • @user3234550: You are trying to use $\frac{\mathrm{d}}{\mathrm{d}x}\frac1{1+x}=\frac{-1}{(1+x)^2}$ and $\frac{\mathrm{d}}{\mathrm{d}x}e^{-x}=-e^{-x}$. Those are exactly what I used in $(1)$ and $(2)$ above. Note that the two minuses cancel in $(3)$. – robjohn Jan 22 '15 at 20:16
  • Oh yea they totally do! For the last bit what is going on here, with $e^{-x}$ in the numerator? $$\frac1{1+e^{-x}}\frac{e^{-x}}{1+e^{-x}} =\frac1{1+e^{-x}}\left(1-\frac1{1+e^{-x}}\right)$$ – user3234550 Jan 22 '15 at 20:34
  • $$\begin{align}1-\frac1{1+e^{-x}} &=\frac{(1+e^{-x})-1}{1+e^{-x}}\ &=\frac{e^{-x}}{1+e^{-x}}\end{align}$$ – robjohn Jan 22 '15 at 20:37
  • Wow, that is just beautiful! Okay, my math skills are little rusty, but i'll catch up. Thanks a ton – user3234550 Jan 22 '15 at 20:43