joelgrus / data-science-from-scratch

code for Data Science From Scratch book
MIT License
8.71k stars 4.52k forks source link

BackPropagation Algorithm #2

Closed mkowoods closed 9 years ago

mkowoods commented 9 years ago

Hi,

It looks like in the algorithm for backprop the variable output_layer is used before it's defined in the hidden_deltas list comprehension.

Also, do you have any tips for extending the algorithm for multi-layer networks?

joelgrus commented 9 years ago

Oops, you're right, it's not ever defined, I guess it should probably just be replaced with network[-1].

My sense is that people usually stick with just one hidden layer, see, e.g.:

http://stats.stackexchange.com/questions/181/how-to-choose-the-number-of-hidden-layers-and-nodes-in-a-feedforward-neural-netw

joelgrus commented 9 years ago

OK, it's fixed now. Thanks!