1
$\begingroup$

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

$\endgroup$
7
  • $\begingroup$ Could you format your answer in LaTeX? $\endgroup$
    – balddraz
    Jun 26, 2017 at 18:25
  • $\begingroup$ What is that @ZeroXLR $\endgroup$
    – Rlz
    Jun 26, 2017 at 18:26
  • $\begingroup$ A way to format formulas so that they look nice. $\endgroup$
    – balddraz
    Jun 26, 2017 at 18:28
  • $\begingroup$ Actually the format which is most helpful is called MathJAX and there are many tutorials available. You can take a look at how your question was edited to see what it looks like. $\endgroup$
    – abiessu
    Jun 26, 2017 at 18:29
  • $\begingroup$ Thanks @abiessu I will learn how to do that for future $\endgroup$
    – Rlz
    Jun 26, 2017 at 18:30

6 Answers 6

7
$\begingroup$

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.

$\endgroup$
4
$\begingroup$

$$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$$

$\endgroup$
1
  • $\begingroup$ You were fast XD, actually it isn't easy to type an answer on phone. +1 :-P $\endgroup$ Jun 26, 2017 at 18:33
2
$\begingroup$

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

$\endgroup$
1
$\begingroup$

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$$

$\endgroup$
1
$\begingroup$

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$.

$\endgroup$
1
$\begingroup$

$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.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .