The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

I was about to say the same thing. The following text needs to be updated as well, since it states that the -1 cancels out the positive, when really the calculation used is flawed

doesn't work for me in the code on page 29, 32 as it just gives the product of the first elements of the two lists. I tried w_sum([3,1,5],[1,2,3]) which gave wrong result (6) whereas np.dot gave the correct answer (20). I hope that these errors are corrected so that readers actually get to the meat of things in deep learning. Any suggestions for the code?

doesn't work for me in the code on page 29, 32 as it just gives the product of the first elements of the two lists. I tried w_sum([3,1,5],[1,2,3]) which gave wrong result (6) whereas np.dot gave the correct answer (20). I hope that these errors are corrected so that readers actually get to the meat of things in deep learning. Any suggestions for the code?

Actually I do get 20 with the code below. If you had have reported that you got 3 I would have suggested that maybe you have the return statement as part of the for loop - in which case it would break out after one iteration and return 3, but to get 6 it would have had to break after 2 iterations! Hmmm...

def w_sum(a,b):
assert len(a) == len(b), "Number of Inputs does not equal number of Weights"
output = 0
for i in range(len(a)):
output += (a[i] * b[i])
return output
print(w_sum([3,1,5],[1,2,3]))