# Thread: How to get a value from sigmoid function?

1. ## How to get a value from sigmoid function?

$$x(y) = m\sigma(ny)$$

where $m$ and $n$ are constants and $\sigma(ny)$ the sigmoid function. How can we right the equation for $y(x)$?

$$y(x) = ?$$

2. ## Re: How to get a value from sigmoid function?

The term 'sigmoid function' can refer to a variety of functions but I suspect you are referring to $x(y)= \frac{me^{ny}}{e^{ny}+ 1}$. An obvious first step is to multiply both sides by $e^{ny}+ 1$ to get $x(e^{ny}+ 1)= me^{ny}$ and then $xe^{ny}+ x= me^{ny}$ which we can then write as $xe^{ny}- me^{ny}= e^{ny}(x- m)= -1$. Divide both sides by x- 1 to get $e^{ny}= \frac{-1}{x- m}= \frac{1}{m- x}$.

Now take the natural logarithm of both sides: $ny= ln\left(\frac{1}{m- x}\right)= -ln(m- x)$.

Finally, $y= -\frac{ln(m- x)}{n}$. Of course, that is a real number only for x< m.

3. ## Re: How to get a value from sigmoid function?

Originally Posted by HallsofIvy
Finally, $y= -\frac{ln(m- x)}{n}$. Of course, that is a real number only for x< m.
I probably misunderstand a point.

Consider $n=1, y=0$, then $x=\frac{1}{2}m$ but the $y(x)$ equation does not give the same.

4. ## Re: How to get a value from sigmoid function?

Originally Posted by HallsofIvy
The term 'sigmoid function' can refer to a variety of functions but I suspect you are referring to $x(y)= \frac{me^{ny}}{e^{ny}+ 1}$. An obvious first step is to multiply both sides by $e^{ny}+ 1$ to get $x(e^{ny}+ 1)= me^{ny}$ and then $xe^{ny}+ x= me^{ny}$ which we can then write as $xe^{ny}- me^{ny}= e^{ny}(x- m)= -1$.
This is an error. It should be $e^{ny}(x- m)= -x$, not -1.
Then $e^{ny}= -\frac{x}{x- m}= \frac{x}{m- x}$

$ny= ln\left(\frac{x}{m- x}\right)= ln(x)- ln(m- x)$

$y= \frac{ln(x)- ln(m- x)}{n}$ or $y= \frac{1}{n}ln\left(\frac{x}{m- x}\right)$.

Divide both sides by x- 1 to get $e^{ny}= \frac{-1}{x- m}= \frac{1}{m- x}$.

Now take the natural logarithm of both sides: $ny= ln\left(\frac{1}{m- x}\right)= -ln(m- x)$.

Finally, $y= -\frac{ln(m- x)}{n}$. Of course, that is a real number only for x< m.
Thanks for catching that.