Mish
论文:Mish: A Self Regularized Non-Monotonic Activation Function
年份:2020
通过对激活函数的理论研究,那些类似于Swish的共享特性,包括非单调性、保持小负权值的能力和平滑轮廓。提出多个函数分别为
a
r
c
t
a
n
(
x
)
⋅
s
o
f
t
p
l
u
s
(
x
)
arctan(x)\cdot softplus(x)
arctan(x)⋅softplus(x)、
t
a
n
h
(
x
)
⋅
s
o
f
t
p
l
u
s
(
x
)
tanh(x)\cdot softplus(x)
tanh(x)⋅softplus(x)、
x
⋅
l
o
g
(
1
+
a
r
c
t
a
n
(
e
x
)
)
x\cdot log(1+arctan(e^x))
x⋅log(1+arctan(ex))、
x
⋅
l
o
g
(
1
+
t
a
n
h
(
e
x
)
)
x\cdot log(1+tanh(e^x))
x⋅log(1+tanh(ex))通过消融试验,我们确定Mish优化与其它函数,Mish的数学公式为:
f
(
x
)
=
x
⋅
t
a
n
h
(
s
o
f
t
p
l
u
s
(
x
)
)
=
x
⋅
t
a
n
h
(
l
o
g
(
1
+
e
x
)
)
f(x) = x\cdot tanh(softplus(x)) = x\cdot tanh(log(1+e^x))
f(x)=x⋅tanh(softplus(x))=x⋅tanh(log(1+ex))
Mish的导数公式为:
f
′
(
x
)
=
e
x
(
4
(
x
+
1
)
+
4
e
2
x
+
e
3
x
+
e
x
(
4
x
+
6
)
(
2
e
x
+
e
2
x
+
2
)
2
f^\prime(x) = \frac{e^x (4(x+1)+4e^{2x}+e^{3x}+e^x(4x+6)}{(2e^x+e^{2x}+2)^2}
f′(x)=(2ex+e2x+2)2ex(4(x+1)+4e2x+e3x+ex(4x+6)
Mish的曲线与导数曲线如下图所示。
- 从图中可以发现Mish是一个光滑、连续、自正则化、非单调的激活函数。
- Mish是有下界、无下界的激活函数,其范围为 [ ≈ − 0.31 , ∞ ] [\approx-0.31, \infty] [≈−0.31,∞]。
- Mish使用了自门控特性,由于保留了少量的负面信息,Mish通过设计消除了死亡ReLU,这有助于更好的表达和信息流。
- 由于上面没有边界,Mish避免了饱和,不会导致梯度消失;有下界会导致强正则化的特性。
- Mish又是连续可微的,这避免了奇异点,在执行基于梯度的优化时避免了不必要的副作用。
- 拥有平滑的轮廓对梯度的流动起到了很好的作用,有助于更容易的优化和更好的泛化。
β \beta β-Mish激活函数
论文:Beta and Alpha Regularizers of Mish Activation Functions for Machine Learning Applications in Deep Neural Networks
年份:2022
β
\beta
β-Mish是Mish的广义扩展,使用
β
\beta
β和
α
\alpha
α两个因子来归一化Mish激活函数边界以下的区域。
β
\beta
β-Mish使用了一个通用的数学表达式
f
(
x
)
=
x
⋅
t
a
n
h
(
l
n
(
1
+
e
α
x
β
+
x
2
)
)
f(x) = x\cdot tanh(ln(1+e^{\frac{\alpha x}{\sqrt{\beta+x^2}}}))
f(x)=x⋅tanh(ln(1+eβ+x2αx))
β
\beta
β-Mish的导数为:
f
′
(
x
)
=
α
β
x
β
+
x
2
e
α
x
β
+
x
2
c
o
s
h
2
(
s
o
f
t
p
l
u
s
x
(
)
)
+
(
x
2
+
β
)
2
(
1
+
e
α
x
β
+
x
2
)
t
a
n
h
(
s
o
f
t
p
l
u
s
(
x
)
)
(
x
2
+
β
)
2
(
1
+
e
α
x
β
+
x
2
)
f^\prime(x) = \frac{\frac{\alpha \beta x \sqrt{\beta+x^2 e^{\frac{\alpha x}{\sqrt{\beta +x^2}}}}}{cosh^2(softplusx())}+(x^2+\beta)^2(1+e^{\frac{\alpha x}{\sqrt{\beta +x^2}}}) tanh(softplus(x))}{(x^2 + \beta)^2(1+e^{\frac{\alpha x}{\sqrt{\beta +x^2}}})}
f′(x)=(x2+β)2(1+eβ+x2αx)cosh2(softplusx())αβxβ+x2eβ+x2αx+(x2+β)2(1+eβ+x2αx)tanh(softplus(x))
α \alpha α的值由 β \beta β决定, α β = 1 5 \frac{\alpha}{\beta}= \frac{1}{5} βα=51, β \beta β的值在 1 ∼ 200 1\sim 200 1∼200, β \beta β-Mish避免了饱和,饱和通常会因为接近0的梯度而快速降低训练速度。
具体的
β
\beta
β-Mish的函数曲线如下图所示
导数曲线如下图
α
\alpha
α最好大于0,
α
\alpha
α越小,该函数的最小值越大,对负值的正则化越弱。