RReLU
- classtorch.nn.RReLU(lower=0.125, upper=0.3333333333333333, inplace=False)[源代码]
-
元素级别应用随机泄漏 rectified 线性单元函数。
论文中提出的方法:卷积网络中修正激活函数的实证评估。
该函数的定义如下:
$\text{RReLU}(x) = \begin{cases} x & \text{if } x \geq 0 \\ ax & \text{ otherwise } \end{cases}$其中,$a$在训练过程中从均匀分布$\mathcal{U}(\text{lower}, \text{upper})$中随机抽取,而在评估过程中则固定为$a = \frac{\text{lower} + \text{upper}}{2}$。
- 参数
- 形状:
-
-
输入: $(*)$,其中$*$表示任意维度的数量。
-
输出: $(*)$,形状与输入相同。
-
示例:
>>> m = nn.RReLU(0.1, 0.3) >>> input = torch.randn(2) >>> output = m(input)