Skip to content
fn

rrelu_

→Tensor
rrelu_(input: Tensor, lower: float = 1.0 / 8, upper: float = 1.0 / 3, training: bool = False, inplace: bool = True)

In-place RReLU — randomised leaky ReLU written back into input.

During training the negative-slope is sampled per-element from a uniform U(lower,upper)U(\text{lower}, \text{upper}); at inference the midpoint (lower+upper)/2(\text{lower} + \text{upper}) / 2 is used.

Parameters

inputTensor
Input; modified in place.
lowerfloat= 1.0 / 8
Lower bound of the uniform slope sampler. Default 1/8.
upperfloat= 1.0 / 3
Upper bound of the uniform slope sampler. Default 1/3.
trainingbool= False
When False (default) uses the deterministic midpoint slope; when True samples a fresh slope per element.
inplacebool= True
False returns rrelu's fresh result instead. Default True.

Returns

Tensor

The same input tensor, now holding rrelu(input, lower, upper, training).

Used by 1