Created
February 2, 2017 05:25
-
-
Save hackintoshrao/3d5b2015e9479a3e51e82b5d5c9932fa to your computer and use it in GitHub Desktop.
simplest neural network
This file contains hidden or 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
| import numpy as np | |
| def sigmoid(x): | |
| # sigmoid function | |
| return 1/(1+np.exp(-x)) | |
| inputs = np.array([0.7, -0.3]) | |
| weights = np.array([0.1, 0.8]) | |
| bias = -0.1 | |
| # TODO: Calculate the output | |
| output = sigmoid(np.dot(inputs,weights)+bias) | |
| print('Output:') | |
| print(output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment