快捷键

RReLU

class torch.nn.RReLU(lower=0.125, upper=0.3333333333333333, inplace=False)[source][source]

应用随机泄漏 ReLU 函数,逐元素。

论文中描述的方法:卷积网络中修正激活的实证评估。

函数定义为:

RReLU(x)={xif x0ax otherwise \text{RReLU}(x) = \begin{cases} x & \text{if } x \geq 0 \\ ax & \text{ otherwise } \end{cases}

其中 aa 在训练期间从均匀分布 U(lower,upper)\mathcal{U}(\text{lower}, \text{upper}) 中随机采样,而在评估期间 aa 固定为 a=lower+upper2a = \frac{\text{lower} + \text{upper}}{2}

参数:
  • 下限(浮点数)- 均匀分布的下限。默认: 18\frac{1}{8}

  • 上限(浮点数)- 均匀分布的上限。默认: 13\frac{1}{3}

  • inplace(布尔值)- 可选地进行原地操作。默认: False

形状:
  • 输入: ()(*) ,其中 * 表示任意数量的维度。

  • 输出: ()(*) ,与输入具有相同的形状。

../_images/RReLU.png

示例:

>>> m = nn.RReLU(0.1, 0.3)
>>> input = torch.randn(2)
>>> output = m(input)

© 版权所有 PyTorch 贡献者。

使用 Sphinx 构建,并使用 Read the Docs 提供的主题。

文档

PyTorch 的全面开发者文档

查看文档

教程

深入了解初学者和高级开发者的教程

查看教程

资源

查找开发资源并获得您的疑问解答

查看资源