Skip to content

Instantly share code, notes, and snippets.

@jamesloyys
Created May 14, 2018 08:37
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jamesloyys/8a391835e71bdf82cf0e2e2e04392416 to your computer and use it in GitHub Desktop.
Save jamesloyys/8a391835e71bdf82cf0e2e2e04392416 to your computer and use it in GitHub Desktop.
class NeuralNetwork:
def __init__(self, x, y):
self.input = x
self.weights1 = np.random.rand(self.input.shape[1],4)
self.weights2 = np.random.rand(4,1)
self.y = y
self.output = np.zeros(self.y.shape)
def feedforward(self):
self.layer1 = sigmoid(np.dot(self.input, self.weights1))
self.output = sigmoid(np.dot(self.layer1, self.weights2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment