Skip to content

Commit

Permalink
working the remaining parts
Browse files Browse the repository at this point in the history
  • Loading branch information
doolin committed Feb 21, 2016
1 parent f7ae3ac commit a52ae93
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions dss/nn/python/numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,16 @@
num_hidden = 5 # we'll have 5 neurons in the hidden layer
output_size = 10 # we need 10 outputs for each input

# each hidden neuron has one weight per input, plus a bias weight
hidden_layer = [[random.random() for __ in range(input_size + 1)]
for __ in range(num_hidden)]

# each output neuron has one weight per hidden neuron, plus a bias weight
output_layer = [[random.random() for __ in range(num_hidden + 1)]
for __ in range(output_size)]

# the network starts out with random weights
network = [hidden_layer, output_layer]

# train it using the back propagation algorithm
# 10,000 iterations seems enough to converge

0 comments on commit a52ae93

Please sign in to comment.