Hard Swish (HardSwish)#
API#
- class warp_nn.modules.activations.HardSwish(*, requires_grad: bool = True)[source]#
Bases:
ModuleHard Swish (HardSwish) activation function.
This class computes the element-wise Hard Swish activation function:
\[\text{HardSwish}(x) = x \, \frac{\min(\max(x + 3, 0), 6)}{6}\]- Parameters:
requires_grad – Whether the cached output arrays of the module require gradients.