In this pytorch neural network tutorial tutorial link
I'm confuse why we need to use relu before max pooling.
Isn't the pixel values in the image are already positive?
I don't know why relu max(0, x)
is needed.
Can anybody give me some advise on this issue?
class Net(nn.Module):
...(init function)
def forward(self, x):
x = F.max_pool2d(F.relu(self.conv1(x)), (2, 2)) # Max pooling over a (2, 2) window