评价此页

torch.nn.functional.softplus#

torch.nn.functional.softplus(input, beta=1, threshold=20) Tensor#

将元素应用函数 Softplus(x)=1βlog(1+exp(βx))\text{Softplus}(x) = \frac{1}{\beta} * \log(1 + \exp(\beta * x))

为了数值稳定性,当 input×β>thresholdinput \times \beta > threshold 时,实现会回退到线性函数。

更多细节请参阅 Softplus