Hard Sigmoid#
API#
- class warp_nn.modules.activations.HardSigmoid( )[source]#
Bases:
ModuleHard Sigmoid activation function.
This class computes the element-wise Hard Sigmoid activation function:
\[\text{HardSigmoid}(x) = \max(0, \min(1, \alpha \, x + \beta))\]Note
The default values match PyTorch’s
Hardsigmoid(the defaultalphavalue of the ONNXHardSigmoidoperator is 0.2).- Parameters:
alpha – The slope of the linear region.
beta – The offset of the linear region.
requires_grad – Whether the cached output arrays of the module require gradients.