From ac1c600a8df2c92ef2dc29516dd1cdecffa0cb5e Mon Sep 17 00:00:00 2001
From: Maxxhim <maxc2507@gmail.com>
Date: Fri, 3 Apr 2020 16:07:45 +0200
Subject: [PATCH] patch v5 matrix mult

---
 functions.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/functions.py b/functions.py
index 5d39d80..779ba14 100644
--- a/functions.py
+++ b/functions.py
@@ -143,10 +143,8 @@ class MatMul(_Function):
         # TODO: Implement the derivative dx for this opetation and add the
         # result of the chain rule on self.dx.
         #######################################################################
-        #self.dx = grad.dot(self.y.data.transpose())
-        #self.dy = grad.dot(self.x.data.transpose())
-        self.dx = grad * np.add(self.x.data, self.y.data.transpose())
-        self.dy = np.add(self.x.data.transpose(), self.y.data) * grad
+        self.dx = grad.dot(self.y.data.transpose())
+        self.dy = (self.x.data.transpose()).dot(grad)
         #######################################################################
         # --------------------------- END OF YOUR CODE ------------------------
         #######################################################################
-- 
GitLab