From 4a8a229bfcf6495ddad2b06827c82116daefef6a Mon Sep 17 00:00:00 2001 From: Maxxhim <maxc2507@gmail.com> Date: Fri, 3 Apr 2020 18:03:02 +0200 Subject: [PATCH] patch v5 relu --- functions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/functions.py b/functions.py index f19feee..cf86c0b 100644 --- a/functions.py +++ b/functions.py @@ -385,8 +385,9 @@ class ReLu(_Function): # TODO: Implement the derivative dx for this opetation and add the # result of the chain rule on self.dx. ####################################################################### - is_sup = self.x.data > 0 - self.dx = grad * is_sup + # is_sup = self.x.data > 0 + # self.dx = grad * is_sup + self.dx = grad * (self.x.data > 0) ####################################################################### # --------------------------- END OF YOUR CODE ------------------------ ####################################################################### -- GitLab