Skip to content

Instantly share code, notes, and snippets.

@ugik
Last active January 21, 2017 00:28
Show Gist options
  • Save ugik/02d9b7b6ec5fcdb213d3f02551c6f051 to your computer and use it in GitHub Desktop.
Save ugik/02d9b7b6ec5fcdb213d3f02551c6f051 to your computer and use it in GitHub Desktop.
class NeuralNetwork():
def __init__(self):
# Seed the random number generator, so it generates the same numbers
# every time the program runs.
random.seed(1)
# We model a single neuron, with 3 input connections and 1 output connection.
# We assign random weights to a 3 x 1 matrix, with values in the range -1 to 1
# and mean 0.
self.synaptic_weights = 2 * random.random((3, 1)) - 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment