Swish function

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

The swish function is a family of mathematical function defined as follows:

File:Swish.svg
The swish function
swishβ(x)=xsigmoid(βx)=x1+eβx.[1]

where β can be constant (usually set to 1) or trainable and "sigmoid" refers to the logistic function.

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 [2]: Eq 3 . Variants of the swish function include Mish.[3]

Special values

[edit | edit source]

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.[1]

Since swishβ(x)=swish1(βx)/β, all instances of swish have the same shape as the default swish1, zoomed by β. One usually sets β>0. When β is trainable, this constraint can be enforced by β=eb, where b is trainable.

swish1(x)=x2+x24x448+x6480+O(x8)

swish1(x)=x2tanh(x2)+x2swish1(x)+swish1(x)=xtanh(x2)swish1(x)swish1(x)=x

Derivatives

[edit | edit source]

Because swishβ(x)=swish1(βx)/β, it suffices to calculate its derivatives for the default case.swish1(x)=x+sinh(x)4cosh2(x2)+12so swish1(x)12 is odd.swish1(x)=1x2tanh(x2)2cosh2(x2)so swish1(x) is even.

History

[edit | edit source]

SiLU was first proposed alongside the GELU in 2016,[4] then again proposed in 2017 as the Sigmoid-weighted Linear Unit (SiL) in reinforcement learning.[5][1] 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.[1] It is believed that one reason for the improvement is that the swish function helps alleviate the vanishing gradient problem during backpropagation.[6]

See also

[edit | edit source]

References

[edit | edit source]
  1. ^ a b c d Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  2. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  3. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  4. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  5. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  6. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).