Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
neural network1
import numpy
def NN(m1, m2, w1, w2, b):
z = m1 * w1 + m2 * w2 + b
return sigmoid(z)
def sigmoid(x):
return 1/(1 + numpy.exp(-x))
w1 = numpy.random.randn()
w2 = numpy.random.randn()
b = numpy.random.randn()
print(NN(2, 3.5, w1, w2, b))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment