How to convert between the logit function and the sigmoid?

277 Views Asked by At

So I just learnt that the two are inverses of each other. This might be a completely stupid question... but what's the calculation to convert this: $$\log \frac {x} {(1-x)}$$ into this: $$\frac {1} {1+e^{-x}}$$ and while we're at it, the last equation into this: $$\frac {e^x} {e^x+1}$$ Thanks!

1

There are 1 best solutions below

1
On BEST ANSWER

Starting from $$ y = \log \frac {x} {(1-x)} $$ solve for $x$.
First exponentiate both sides $$ e^y = \frac {x} {(1-x)} $$ Invert $$ \frac{1}{e^{y}} = \frac{1-x}{x} \\ e^{-y} = \frac{1}{x}-1 $$ Add $1$ $$ 1+e^{-y} = \frac{1}{x} $$ and invert $$ \frac{1}{1+e^{-y}} = x $$