BReLU is an activation function proposed to improve training stability by limiting the output of ReLU to a fixed range.
BReLU rectifies at two points, 0 and A (a constant), which is thought to make training more stable.
Its output range is:
Activation Functions
Updated:
BReLU is an activation function proposed to improve training stability by limiting the output of ReLU to a fixed range.
BReLU rectifies at two points, 0 and A (a constant), which is thought to make training more stable.
Its output range is:
# PyTorch
import torch
import torch.nn as nn
class NN(nn.Module):
def __init__(self):
super().__init__()
self.A = 3.0
self.relu = nn.ReLU()
def b_relu(self, x):
return torch.minimum(self.relu(x), torch.tensor(self.A))
def forward(self, x):
x = self.b_relu(x)
return x