- Source: Swish function
The swish function is a family of mathematical function defined as follows:
swish
β
(
x
)
=
x
sigmoid
(
β
x
)
=
x
1
+
e
−
β
x
.
{\displaystyle \operatorname {swish} _{\beta }(x)=x\operatorname {sigmoid} (\beta x)={\frac {x}{1+e^{-\beta x}}}.}
where
β
{\displaystyle \beta }
can be constant (usually set to 1) or trainable.
The swish family was designed to smoothly interpolate between a linear function and the ReLU function.
When considering positive values, Swish is a particular case of doubly parameterized sigmoid shrinkage function defined in : Eq 3 . Variants of the swish function include Mish.
Special values
For β = 0, the function is linear: f(x) = x/2.
For β = 1, the function is the Sigmoid Linear Unit (SiLU).
With β → ∞, the function converges to ReLU.
Thus, the swish family smoothly interpolates between a linear function and the ReLU function.
Since
swish
β
(
x
)
=
swish
1
(
β
x
)
/
β
{\displaystyle \operatorname {swish} _{\beta }(x)=\operatorname {swish} _{1}(\beta x)/\beta }
, all instances of swish have the same shape as the default
swish
1
{\displaystyle \operatorname {swish} _{1}}
, zoomed by
β
{\displaystyle \beta }
. One usually sets
β
>
0
{\displaystyle \beta >0}
. When
β
{\displaystyle \beta }
is trainable, this constraint can be enforced by
β
=
e
b
{\displaystyle \beta =e^{b}}
, where
b
{\displaystyle b}
is trainable.
swish
1
(
x
)
=
x
2
+
x
2
4
−
x
4
48
+
x
6
480
+
O
(
x
8
)
{\displaystyle \operatorname {swish} _{1}(x)={\frac {x}{2}}+{\frac {x^{2}}{4}}-{\frac {x^{4}}{48}}+{\frac {x^{6}}{480}}+O\left(x^{8}\right)}
swish
1
(
x
)
=
x
2
tanh
(
x
2
)
+
x
2
swish
1
(
x
)
+
swish
−
1
(
x
)
=
x
tanh
(
x
2
)
swish
1
(
x
)
−
swish
−
1
(
x
)
=
x
{\displaystyle {\begin{aligned}\operatorname {swish} _{1}(x)&={\frac {x}{2}}\tanh \left({\frac {x}{2}}\right)+{\frac {x}{2}}\\\operatorname {swish} _{1}(x)+\operatorname {swish} _{-1}(x)&=x\tanh \left({\frac {x}{2}}\right)\\\operatorname {swish} _{1}(x)-\operatorname {swish} _{-1}(x)&=x\end{aligned}}}
Derivatives
Because
swish
β
(
x
)
=
swish
1
(
β
x
)
/
β
{\displaystyle \operatorname {swish} _{\beta }(x)=\operatorname {swish} _{1}(\beta x)/\beta }
, it suffices to calculate its derivatives for the default case.
swish
1
′
(
x
)
=
x
+
sinh
(
x
)
4
cosh
2
(
x
2
)
+
1
2
{\displaystyle \operatorname {swish} _{1}'(x)={\frac {x+\sinh(x)}{4\cosh ^{2}\left({\frac {x}{2}}\right)}}+{\frac {1}{2}}}
so
swish
1
′
(
x
)
−
1
2
{\displaystyle \operatorname {swish} _{1}'(x)-{\frac {1}{2}}}
is odd.
swish
1
″
(
x
)
=
1
−
x
2
tanh
(
x
2
)
2
cosh
2
(
x
2
)
{\displaystyle \operatorname {swish} _{1}''(x)={\frac {1-{\frac {x}{2}}\tanh \left({\frac {x}{2}}\right)}{2\cosh ^{2}\left({\frac {x}{2}}\right)}}}
so
swish
1
″
(
x
)
{\displaystyle \operatorname {swish} _{1}''(x)}
is even.
History
SiLU was first proposed alongside the GELU in 2016, then again proposed in 2017 as the Sigmoid-weighted Linear Unit (SiL) in reinforcement learning. The SiLU/SiL was then again proposed as the SWISH over a year after its initial discovery, originally proposed without the learnable parameter β, so that β implicitly equaled 1. The swish paper was then updated to propose the activation with the learnable parameter β.
In 2017, after performing analysis on ImageNet data, researchers from Google indicated that using this function as an activation function in artificial neural networks improves the performance, compared to ReLU and sigmoid functions. It is believed that one reason for the improvement is that the swish function helps alleviate the vanishing gradient problem during backpropagation.
References
Kata Kunci Pencarian:
- Daftar startup Y Combinator
- Daftar singkatan matematis
- Swish function
- Sigmoid function
- Rectifier (neural networks)
- Swish
- List of mathematical abbreviations
- Activation function
- Ride cymbal
- Backpropagation
- Dedekind eta function
- Gating mechanism