Swish#
API#
- class warp_nn.modules.activations.Swish(*, alpha: float = 1.0, requires_grad: bool = True)[source]#
Bases:
ModuleSwish activation function.
This class computes the element-wise Swish activation function:
\[\text{Swish}(x) = x \, \sigma(\alpha \, x) = \frac{x}{1 + e^{-\alpha \, x}}\]With the default
alphavalue, it is the Sigmoid Linear Unit (SiLU) activation function (PyTorch’sSiLU).- Parameters:
alpha – The coefficient that multiplies the input of the sigmoid function.
requires_grad – Whether the cached output arrays of the module require gradients.