Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class NeuralNetwork(object):
- ...
- def predict(self, x):
- layer1 = sigmoid(np.dot(x, self.weights1))
- output = sigmoid(np.dot(layer1, self.weights2))
- return output
- x_seen = np.array([1, 1, 0])
- print(nn.predict(x_seen))
- # [0.01162975]
- x_unseen = np.array()
- print(nn.predict(x_unseen))
- # [0.84968032]
Add Comment
Please, Sign In to add comment