LeakyReLU
keras.layers.advanced_activations.LeakyReLU(alpha=0.3)
Leaky version of a Rectified Linear Unit.
It allows a small gradient when the unit is not active:
f(x) = alpha * x for x < 0
,
f(x) = x for x >= 0
.
Input shape
Arbitrary. Use the keyword argument input_shape
(tuple of integers, does not include the samples axis)
when using this layer as the first layer in a model.
Output shape
Same shape as the input.
Arguments
- alpha: float >= 0. Negative slope coefficient.
References
PReLU
keras.layers.advanced_activations.PReLU(init='zero', weights=None, shared_axes=None)
Parametric Rectified Linear Unit.
It follows:
f(x) = alphas * x for x < 0
,
f(x) = x for x >= 0
,
where alphas
is a learned array with the same shape as x.
Input shape
Arbitrary. Use the keyword argument input_shape
(tuple of integers, does not include the samples axis)
when using this layer as the first layer in a model.
Output shape
Same shape as the input.
Arguments
- init: initialization function for the weights.
- weights: initial weights, as a list of a single Numpy array.
- shared_axes: the axes along which to share learnable
parameters for the activation function.
For example, if the incoming feature maps
are from a 2D convolution
with output shape
(batch, height, width, channels)
, and you wish to share parameters across space so that each filter only has one set of parameters, setshared_axes=[1, 2]
.
References
ELU
keras.layers.advanced_activations.ELU(alpha=1.0)
Exponential Linear Unit.
It follows:
f(x) = alpha * (exp(x) - 1.) for x < 0
,
f(x) = x for x >= 0
.
Input shape
Arbitrary. Use the keyword argument input_shape
(tuple of integers, does not include the samples axis)
when using this layer as the first layer in a model.
Output shape
Same shape as the input.
Arguments
- alpha: scale for the negative factor.
References
ParametricSoftplus
keras.layers.advanced_activations.ParametricSoftplus(alpha_init=0.2, beta_init=5.0, weights=None, shared_axes=None)
Parametric Softplus.
It follows:
f(x) = alpha * log(1 + exp(beta * x))
Input shape
Arbitrary. Use the keyword argument input_shape
(tuple of integers, does not include the samples axis)
when using this layer as the first layer in a model.
Output shape
Same shape as the input.
Arguments
- alpha_init: float. Initial value of the alpha weights.
- beta_init: float. Initial values of the beta weights.
- weights: initial weights, as a list of 2 numpy arrays.
- shared_axes: the axes along which to share learnable
parameters for the activation function.
For example, if the incoming feature maps
are from a 2D convolution
with output shape
(batch, height, width, channels)
, and you wish to share parameters across space so that each filter only has one set of parameters, setshared_axes=[1, 2]
.
References
ThresholdedReLU
keras.layers.advanced_activations.ThresholdedReLU(theta=1.0)
Thresholded Rectified Linear Unit.
It follows:
f(x) = x for x > theta
,
f(x) = 0 otherwise
.
Input shape
Arbitrary. Use the keyword argument input_shape
(tuple of integers, does not include the samples axis)
when using this layer as the first layer in a model.
Output shape
Same shape as the input.
Arguments
- theta: float >= 0. Threshold location of activation.
References
SReLU
keras.layers.advanced_activations.SReLU(t_left_init='zero', a_left_init='glorot_uniform', t_right_init='glorot_uniform', a_right_init='one', shared_axes=None)
S-shaped Rectified Linear Unit.
It follows:
f(x) = t^r + a^r(x - t^r) for x >= t^r
,
f(x) = x for t^r > x > t^l
,
f(x) = t^l + a^l(x - t^l) for x <= t^l
.
Input shape
Arbitrary. Use the keyword argument input_shape
(tuple of integers, does not include the samples axis)
when using this layer as the first layer in a model.
Output shape
Same shape as the input.
Arguments
- t_left_init: initialization function for the left part intercept
- a_left_init: initialization function for the left part slope
- t_right_init: initialization function for the right part intercept
- a_right_init: initialization function for the right part slope
- shared_axes: the axes along which to share learnable
parameters for the activation function.
For example, if the incoming feature maps
are from a 2D convolution
with output shape
(batch, height, width, channels)
, and you wish to share parameters across space so that each filter only has one set of parameters, setshared_axes=[1, 2]
.
References