swish

dragon.vm.tensorflow.keras.activations.swish(x)[source]

Apply the swish function. [Ramachandran et.al, 2017].

The Swish function is defined as:

Swish(x)=x11+exp(x)\text{Swish}(x) = x \cdot \frac{1}{1 + \exp(-x)}

Examples:

x = tf.constant([-2.5, -1.0, 0.0, 1.0, 2.5])
print(tf.keras.activations.swish(x))
Parameters:
Returns:

dragon.Tensor The output tensor.