swish

dragon.nn.swish(
  inputs,
  **kwargs
)[source]

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

The Swish function is defined as:

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

Examples:

x = dragon.constant([-2.5, -1.0, 0.0, 1.0, 2.5])
print(dragon.nn.swish(x))
Parameters:
Returns:

dragon.Tensor – The output tensor.