# RReLU¶

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

Applies the randomized leaky rectified liner unit function, element-wise, as described in the paper:

The function is defined as:

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

where $a$ is randomly sampled from uniform distribution $\mathcal{U}(\text{lower}, \text{upper})$ .

Parameters
• lower – lower bound of the uniform distribution. Default: $\frac{1}{8}$

• upper – upper bound of the uniform distribution. Default: $\frac{1}{3}$

• inplace – can optionally do the operation in-place. Default: False

Shape:
• Input: $(N, *)$ where * means, any number of additional dimensions

• Output: $(N, *)$ , same shape as the input

Examples:

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