torch.nn.functional.softplus — PyTorch 2.7 documentation (original) (raw)
torch.nn.functional.softplus(input, beta=1, threshold=20) → Tensor¶
Applies element-wise, the function Softplus(x)=1β∗log(1+exp(β∗x))\text{Softplus}(x) = \frac{1}{\beta} * \log(1 + \exp(\beta * x)).
For numerical stability the implementation reverts to the linear function when input×β>thresholdinput \times \beta > threshold.
See Softplus for more details.
To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.