快捷方式

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.}

注意

參見 Gaussian Error Linear Units (GELUs)(SiLU (Sigmoid 線性單元) 最初在此提出),另參見 Sigmoid-Weighted Linear Units for Neural Network Function Approximation in Reinforcement LearningSwish: a Self-Gated Activation Function(SiLU 後來在此進行實驗)。

更多詳細資訊請參閱 SiLU

返回型別

Tensor

文件

查閱 PyTorch 的全面開發者文件

查閱文件

教程

獲取適合初學者和高階開發者的深度教程

查閱教程

資源

查詢開發資源並解答問題

查閱資源