评价此页

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