# 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 $\displaystyle x(y)= \frac{me^{ny}}{e^{ny}+ 1}$. An obvious first step is to multiply both sides by $\displaystyle e^{ny}+ 1$ to get $\displaystyle x(e^{ny}+ 1)= me^{ny}$ and then $\displaystyle xe^{ny}+ x= me^{ny}$ which we can then write as $\displaystyle xe^{ny}- me^{ny}= e^{ny}(x- m)= -1$. Divide both sides by x- 1 to get $\displaystyle e^{ny}= \frac{-1}{x- m}= \frac{1}{m- x}$.

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

Finally, $\displaystyle 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, $\displaystyle 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 $\displaystyle x(y)= \frac{me^{ny}}{e^{ny}+ 1}$. An obvious first step is to multiply both sides by $\displaystyle e^{ny}+ 1$ to get $\displaystyle x(e^{ny}+ 1)= me^{ny}$ and then $\displaystyle xe^{ny}+ x= me^{ny}$ which we can then write as $\displaystyle xe^{ny}- me^{ny}= e^{ny}(x- m)= -1$.
This is an error. It should be $\displaystyle e^{ny}(x- m)= -x$, not -1.
Then $\displaystyle e^{ny}= -\frac{x}{x- m}= \frac{x}{m- x}$

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

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

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

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

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