chainer.functions.swish¶
-
chainer.functions.
swish
(x, beta)[source]¶ Swish activation function.
f(x,β)=x⋅σ(βx),where σ(⋅) is the sigmoid function. It has the following properties:
f(x,0)=x2,lim- Parameters
x (
Variable
or N-dimensional array) – Input variable of shape (s_B, s_1, s_2, ..., s_N), where s_B is assumed to be the minibatch dimension.beta (
Variable
or N-dimensional array) – Parameter variable \beta of shape (s_1, s_2, ..., s_M), where M is an arbitrary integer between 0 \leq M \leq N. The number of dimensions ofbeta
will be matched withx
by reshaping it as (1, s_1, ..., s_M, 1, ... 1), thenbeta
andx
are multiplied together in an element-wise manner.
- Returns
Output variable of the same shape as
x
.- Return type
See also