美文网首页
logistic 函数

logistic 函数

作者: 何狗带 | 来源:发表于2017-11-07 16:45 被阅读0次

1.logistic函数

    logistic函数公式大概如下:


    这个函数是一个S曲线,得到的结果在0和1之间,x的值越大,s(x)越接近1,x的值越小,s(x)越接近0,具体曲线如下:


2.theano实现logistic函数

    具体代码: 

x = theano.tensor.dmatrix('x')

s = 1/(1 + T.exp(-x))

logistic  = theano.function([x], s)



    e的-x次方在theano中用 theano.tensor.exp(-x)表示。

    函数会将对矩阵的每个参数进行计算,得到的结果以也是一个矩阵。

相关文章

网友评论

      本文标题:logistic 函数

      本文链接:https://www.haomeiwen.com/subject/tfpjmxtx.html