java 逆逻辑函数/逆 Sigmoid 函数
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10097891/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Inverse Logistic Function / Reverse Sigmoid Function
提问by schanq
I am currently coding up a fuzzy logic library in java. I have found the equations for all the standard functions - Grade, inverseGrade, Triangle, Trapezoid, Gaussian. However, I can't find the inverse of the sigmoid/ logistic function.
我目前正在用 java 编写一个模糊逻辑库。我找到了所有标准函数的方程 - Grade、inverseGrade、Triangle、Trapezoid、Gaussian。但是,我找不到 sigmoid/logistic 函数的逆函数。
The way I have written the logistic function is java is :
我编写逻辑函数的方式是 java 是:
//f(x) = 1/(1+e(-x))
public double logistic(double x){
return (1/(1+(Math.exp(-x)));
}
But I can't work out or find the inverse anywhere. My algebraic/calculus abilities are fairly limited, hence why I haven't been able to work out the inverse of the function.
但我无法在任何地方解决或找到逆。我的代数/微积分能力相当有限,因此我无法计算出函数的倒数。
Any hints or pointers would be a big help.
任何提示或指示都会有很大帮助。
Thanks
谢谢
回答by tom10
If
如果
y = 1/(1+exp(-x))
then
然后
x = ln(y/(1-y))