评价此页

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