How do I find $x$ if I know $y$

167 Views Asked by At

I have the equation for a sigmoid with the following

$$y = \frac{1}{1+e^{-x}}$$

How do I find what the value of $x$ is if I know $y$?

For example:

if $y = 0.5$ then what is $x$?

(The answer for the example, I believe, is $0$)

Edit: If you are please going to downvote, please explain why, otherwise I cannot improve my questions in the future

6

There are 6 best solutions below

0
On BEST ANSWER

All you need to do is solve for $x$: $$y=\frac{1}{1+e^{-x}}$$ $$\frac{1}{y}=1+e^{-x}$$ $$\frac{1}{y}-1=e^{-x}$$ $$\ln\bigg(\frac{1}{y}-1\bigg)=-x$$ $$x=-\ln\bigg(\frac{1}{y}-1\bigg)$$ As for the case $y=0.5$, we have $$x=-\ln\bigg(\frac{1}{0.5}-1\bigg)$$ $$x=-\ln(2-1)$$ $$x=-\ln(1)$$ $$x=0$$ So your guess was correct.

0
On

solving $$y=\frac{1}{1+e^{-x}}$$ for $$x$$: $$1+e^{-x}=\frac{1}{y}$$ and we get $$-x=\ln\left(\frac{1}{y}-1\right)$$ and now you can insert $$y=0.5$$ in this equation

1
On

$$y=\frac{1}{1+e^{-x}} \implies 1+e^{-x}=\frac 1y \implies e^{-x}=\frac 1y-1$$

$$e^{-x}=\frac{1-y}{y}\implies e^x=\frac{y}{y-1}$$$$ \implies \boxed{x=\ln \left(\frac{y}{1-y}\right)}$$

Now plug-in $y=0.5$.

$$\implies x=\ln \left(\frac{0.5}{1-0.5}\right)=\ln (1)=0$$

0
On

$0.5=\frac{1}{1+e^{-x}} \implies 1=e^{-x}\implies -x\ln e=\ln 1 $ which yields $x=0$.

I let you conclude what is happening there, which is easy enough if you know a bit about logarithms.

0
On

Your hunch is right.

$$0.5 = \frac{1}{1+e^{-x}}$$

$$\frac{1}{0.5} = 1 + e^{-x}$$

$$ln\ [\frac{1}{0.5} - 1] = ln\ [e^{-x}]$$

$$ln\ [1] = -x$$

$$x = 0$$

0
On

We wish to solve

$$ 0.5 = \frac{1}{1+e^{-x}} $$

Okay, sure. Cross-multiply/butterfly/whatever you want to call it first.

$$ 0.5(1 + e^{-x} ) = 1 $$

Divide by $0.5$.

$$ 1 + e^{-x} = 2 $$

Subtract $1$, take logs.

$$ -x = 0 $$

Hence $ x = 0$.