hardswish¶
dragon.nn.
hardswish
(
inputs,
**kwargs
)[source]¶Apply the hard swish function. [Howard et.al, 2019].
The HardSwish function is defined as:
\[\text{HardSwish}(x) = x \cdot \max(0, \min(1, \frac{x}{6} + 0.5)) \]Examples:
x = dragon.constant([-3., -1., 0., 1., 3.]) print(dragon.nn.hardswish(x))
- Parameters:
- inputs (dragon.Tensor) – The input tensor.
- Returns:
dragon.Tensor – The output tensor.