diff --git a/functions.py b/functions.py index a87d35179d6f7c52d4ee49b1d0ba711af63af731..f19feeea6a0336a86ffe3bab04174799a5d99730 100644 --- a/functions.py +++ b/functions.py @@ -385,7 +385,7 @@ class ReLu(_Function): # TODO: Implement the derivative dx for this opetation and add the # result of the chain rule on self.dx. ####################################################################### - is_sup = 0 if self.x.data <= 0 else 1 + is_sup = self.x.data > 0 self.dx = grad * is_sup ####################################################################### # --------------------------- END OF YOUR CODE ------------------------