LeakyReLU¶
- class torch.nn.LeakyReLU(negative_slope=0.01, inplace=False)[source][source]¶
逐元素应用 LeakyReLU 函数。
或者
- 参数:
negative_slope (浮点数) – 控制负斜率的倾斜角度(用于负输入值)。默认:1e-2
inplace(布尔值)- 可选地进行原地操作。默认:
False
- 形状:
输入: 其中 * 表示任意数量的额外维度
输出: ,与输入具有相同的形状
示例:
>>> m = nn.LeakyReLU(0.1) >>> input = torch.randn(2) >>> output = m(input)