SELU¶
- class torch.nn.SELU(inplace=False)[來源][來源]¶
逐元素套用 SELU 函數。
其中 且 。
警告
當使用
kaiming_normal
或kaiming_normal_
進行初始化時,為了獲得自正規化神經網路,應該使用nonlinearity='linear'
,而不是nonlinearity='selu'
。詳情請參考torch.nn.init.calculate_gain()
。更多細節請參考論文 Self-Normalizing Neural Networks 。
- 參數
inplace (bool, optional) – 是否選擇性地進行原地 (in-place) 操作。預設值:
False
- 形狀
輸入:,其中 代表任意數量的維度。
輸出:,與輸入相同的形狀。
範例
>>> m = nn.SELU() >>> input = torch.randn(2) >>> output = m(input)