Created
November 13, 2018 15:23
-
-
Save bmwant/a3aac4b1ec506547134477a1a1f3ebf3 to your computer and use it in GitHub Desktop.
Update with predict to simple neural network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@bmwant When teaching the neural network 10 times from scratch again, predicting 4 examples will return different results.
Is it unpredictable what this small neural network is learning?