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

patch v1 Division

parent a0aa980d
No related branches found
No related tags found
No related merge requests found
......@@ -55,7 +55,7 @@ class Sub(_Function):
# Implement the forward pass and put the result in self.result.
# The notbook provide you the formulas for this operation.
#######################################################################
self.result = x.data - y.data
self.result = self.x.data - self.y.data
#######################################################################
# --------------------------- END OF YOUR CODE ------------------------
#######################################################################
......@@ -91,8 +91,8 @@ class Mul(_Function):
# Implement the derivative dx for this opetation and add the
# result of the chain rule on self.dx.
#######################################################################
self.dx = self.grad * self.y.data
self.dy = self.grad * self.x.data
self.dx = grad * self.y.data
self.dy = grad * self.x.data
#######################################################################
# --------------------------- END OF YOUR CODE ------------------------
#######################################################################
......@@ -117,8 +117,8 @@ class Div(_Function):
# TODO: Implement the derivative dx for this opetation and add the
# result of the chain rule on self.dx.
#######################################################################
self.dx = self.grad * (1/self.y.data)
self.dy = self.grad * ((-1/(self.y.data)^2) * self.x.data)
self.dx = grad * (1/self.y.data)
self.dy = grad * ((-1/(self.y.data)^2) * self.x.data)
#######################################################################
# --------------------------- 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