brainstate.nn.rrelu#
- brainstate.nn.rrelu(x, lower=0.125, upper=0.3333333333333333)[source]#
Randomized Leaky Rectified Linear Unit activation function.
The function is defined as:
\[\begin{split}\text{RReLU}(x) = \begin{cases} x & \text{if } x \geq 0 \\ ax & \text{ otherwise } \end{cases}\end{split}\]where \(a\) is randomly sampled from uniform distribution \(\mathcal{U}(\text{lower}, \text{upper})\).
- Parameters:
x (
Array|ndarray|bool|number|bool|int|float|complex|Quantity) – Input array of any shape.lower (
float) – Lower bound of the uniform distribution for sampling the negative slope. Default is 1/8.upper (
float) – Upper bound of the uniform distribution for sampling the negative slope. Default is 1/3.
- Returns:
Output array with the same shape as the input.
- Return type:
Array|Quantity
References