Ann 6
Ann 6
def feedforward(self):
self.layer1 = sigmoid(np.dot(self.input, self.weights1))
self.output = sigmoid(np.dot(self.layer1, self.weights2))
def backprop(self):
d_weights2 = np.dot(self.layer1.T, (2*(self.y - self.output) * sigmoid_de
d_weights1 = np.dot(self.input.T, (np.dot(2*(self.y - self.output) * sigm
self.weights2.T) * sigmoid_der
self.weights1 += d_weights1
self.weights2 += d_weights2
[[0.01214789]
[0.99053993]
[0.98947693]
[0.00859045]]
In [ ]: