Created
November 23, 2017 13:15
-
-
Save RANUX/3441547c536ea523b5197289ee44f2cd to your computer and use it in GitHub Desktop.
Very simple 2 layer 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 | |
import math | |
inp = np.matrix([[1.0], [0.5]]) | |
weights = np.matrix([[0.9, 0.3],[0.2,0.8]]) | |
x = weights.dot(inp) | |
sigmoid = np.vectorize(lambda x: 1 / (1 + math.exp(-x))) | |
sigmoid(x) | |
#out.append(sigmoid(np.array(wsum)[0])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment