Rectified Linear Unit (ReLU)#
API#
- class warp_nn.modules.activations.ReLU(*, requires_grad: bool = True)[source]#
Bases:
ModuleRectified Linear Unit (ReLU) activation function.
This class computes the element-wise ReLU activation function:
\[\begin{split}\text{ReLU}(x) = \begin{cases} x, & \text{ if } x \geq 0\\ 0, & \text{ if } x < 0 \end{cases}\end{split}\]- Parameters:
requires_grad – Whether the cached output arrays of the module require gradients.