Softplus#
API#
- class warp_nn.modules.activations.Softplus( )[source]#
Bases:
ModuleSoftplus activation function.
This class computes the element-wise Softplus activation function:
\[\text{Softplus}(x) = \frac{1}{\beta} \log(1 + e^{\beta x})\]For numerical stability, the implementation reverts to the linear function when \(\beta \, x > \text{threshold}\).
- Parameters:
beta – The beta value for the Softplus function. It must be non-zero.
threshold – When \(\beta \, x\) exceeds this value, the output reverts to the linear function.
requires_grad – Whether the cached output arrays of the module require gradients.
- Raises:
ValueError – If
betais zero.