Shortcuts

torch.nn.functional.silu

torch.nn.functional.silu(input, inplace=False)[源代码]

逐元素应用Sigmoid线性单元(SiLU)函数。

SiLU 函数也被称为 swish 函数。

silu(x)=xσ(x),where σ(x) is the logistic sigmoid.\text{silu}(x) = x * \sigma(x), \text{where } \sigma(x) \text{ is the logistic sigmoid.}

注意

参见 高斯误差线性单元 (GELUs) 其中首次提出了 SiLU(Sigmoid 线性单元),并参见 用于强化学习中神经网络函数逼近的 Sigmoid 加权线性单元Swish: 一种自门控激活函数 其中后来对 SiLU 进行了实验。

更多详情请参见 SiLU

Return type

张量

优云智算