human
I am working on the file "Seminar3/HW3_Modules.ipynb".
The first task is:
Activation functions
Here's the complete example for the Rectified Linear Unit non-linearity (aka ReLU):
Can you write Python program for it?
 Write me a the Python program you requested?
assistant
#Here is the Python program you requested.

class ReLU(Module):
    def __init__(self):
         super(ReLU, self).__init__()
    
    def updateOutput(self, input):
        self.output = np.maximum(input, 0)
        return self.output
    
    def updateGradInput(self, input, gradOutput):
        self.gradInput = np.multiply(gradOutput , input > 0)
        return self.gradInput
    
    def __repr__(self):
        return "ReLU"