Skip to content
Snippets Groups Projects
Commit ac1c600a authored by Maxxhim's avatar Maxxhim
Browse files

patch v5 matrix mult

parent 5398aa78
No related branches found
No related tags found
No related merge requests found
...@@ -143,10 +143,8 @@ class MatMul(_Function): ...@@ -143,10 +143,8 @@ class MatMul(_Function):
# TODO: Implement the derivative dx for this opetation and add the # TODO: Implement the derivative dx for this opetation and add the
# result of the chain rule on self.dx. # result of the chain rule on self.dx.
####################################################################### #######################################################################
#self.dx = grad.dot(self.y.data.transpose()) self.dx = grad.dot(self.y.data.transpose())
#self.dy = grad.dot(self.x.data.transpose()) self.dy = (self.x.data.transpose()).dot(grad)
self.dx = grad * np.add(self.x.data, self.y.data.transpose())
self.dy = np.add(self.x.data.transpose(), self.y.data) * grad
####################################################################### #######################################################################
# --------------------------- END OF YOUR CODE ------------------------ # --------------------------- END OF YOUR CODE ------------------------
####################################################################### #######################################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment