Skip to content

Instantly share code, notes, and snippets.

@hackintoshrao
Created February 2, 2017 05:25
Show Gist options
  • Select an option

  • Save hackintoshrao/3d5b2015e9479a3e51e82b5d5c9932fa to your computer and use it in GitHub Desktop.

Select an option

Save hackintoshrao/3d5b2015e9479a3e51e82b5d5c9932fa to your computer and use it in GitHub Desktop.
simplest neural network
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