DL 公式_Sigmoid_Softmax_Tanh

来源:互联网 发布:erp管理系统源码 编辑:程序博客网 时间:2024/06/16 19:40

Logistic function

f(x)=Lek(xx0)

e = 自然底数 the natural logarithm base (also known as Euler’s number)
x0 = 中点横坐标 the x-value of the sigmoid’s midpoint
L = 最大值 the curve’s maximum value, and
k = 陡峭程度 the steepness of the curve
Reference: wiki


Sigmoid function

f(x)=11+ex

f(x)=ex(1+ex)2=f(x)(1f(x))
Reference: Logistic Regression

Sigmoid函数是Logistic函数的特殊情况


Softmax

σ(z)j=ezjKk=1ezk for j = 1, …, K

Softmax Regression 别名 Multinomial logistic regression。
Softmax function是sigmoid function在多个类的扩展

当K=2时,Softmax function可以推导成sigmoid function:

Pr(Yi=1)=11+eβXi

Pr(Yi=0)=1Pr(Yi=1)=eβXi1+eβ0Xi

Pr(Yi=1)=eβ1Xi0cKeβcXi=eβ1Xieβ0Xi+eβ1Xi=1e(β0β1)Xi+1=11+eβXi

Pr(Yi=0)=eβ0Xi0cKeβcXi=eβ0Xieβ0Xi+eβ1Xi=e(β0β1)Xie(β0β1)Xi+1=eβXi1+eβXi

其中 β=(β0β1)

Reference1: Softmax和Sigmoid的关系

Reference2: What is the intuition behind SoftMax function?


tanh (Hyperbolic Tangent)

f(x)=exexex+ex=21+e2x1 (sigmoid函数在x轴收缩2倍, y轴扩大2倍再减1)

=12exex+ex=12e2x+1

f2(x)=14exex(ex+ex)2=14e2x(e2x+1)2

f(x)=4e2x(e2x+1)2=1f2(x)


Jaccard index

Intersection over Union
Jaccard similarity coefficient
J(A,B)=|AB||AB|=|AB||A|+|B||AB|