-
Notifications
You must be signed in to change notification settings - Fork 316
Open
Description
Solution 120 shows
1 class Sigmoid:
2 def forward(self,x):
3 self.x = x
4 return 1/(1+np.exp(-x))
5
6 def backward(self, grad):
7 grad_input = self.x*(1-self.x) * grad
8 return grad_input
While I think the correct code should be
def backward(self, grad):
sigmoid_output = self.forward(self.x)
grad_input = sigmoid_output * (1 - sigmoid_output) * grad
return grad_input
Metadata
Metadata
Assignees
Labels
No labels