Threshold#
API#
- class warp_nn.modules.activations.Threshold( )[source]#
Bases:
ModuleThreshold activation function.
This class computes the element-wise Threshold activation function:
\[\begin{split}\text{Threshold}(x) = \begin{cases} x, & \text{ if } x > \text{threshold}\\ \text{value}, & \text{ otherwise} \end{cases}\end{split}\]The ONNX
ThresholdedReluoperator is equivalent toThreshold(threshold=alpha, value=0).- Parameters:
threshold – The value to threshold at.
value – The value to replace with.
requires_grad – Whether the cached output arrays of the module require gradients.