SELU#
- class torch.nn.SELU(inplace=False)[来源]#
逐元素应用 SELU 函数。
其中 且 。
警告
在使用
kaiming_normal
或kaiming_normal_
进行初始化时,应使用nonlinearity='linear'
而不是nonlinearity='selu'
,才能实现 自归一化神经网络。更多信息请参阅torch.nn.init.calculate_gain()
。更多细节可在论文 自归一化神经网络 中找到。
- 参数
inplace (bool, optional) – 可选地原地执行操作。默认值:
False
- 形状
输入: ,其中 表示任意数量的维度。
输出: ,形状与输入相同。
示例
>>> m = nn.SELU() >>> input = torch.randn(2) >>> output = m(input)