Table of Contents
Shortcuts

# RReLU

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

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

  Empirical Evaluation of Rectified Activations in Convolutional Network.

  The function is defined as:

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

  where a a a is randomly sampled from uniform distribution U(lower,upper)\mathcal{U}(\text{lower}, \text{upper})U(lower,upper) during training while during evaluation a a a is fixed with a=lower+upper 2 a = \frac{\text{lower} + \text{upper}}{2}a=2 lower+upper​.

  > See: https://arxiv.org/pdf/1505.00853.pdf

  Parameters:

    - lower (float) – lower bound of the uniform distribution. Default: 1 8\frac{1}{8}8 1​

    - upper (float) – upper bound of the uniform distribution. Default: 1 3\frac{1}{3}3 1​

    - inplace (bool) – can optionally do the operation in-place. Default: `False`

  Shape:

    - Input: (∗)(*)(∗), where ∗*∗ means any number of dimensions.

    - Output: (∗)(*)(∗), same shape as the input.

  Examples:

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

## Docs

Access comprehensive developer documentation for PyTorch

View Docs

## Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

## Resources

Find development resources and get your questions answered

View Resources

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.