Course2 W2 excercise 5

1st question, it just worked fine in exercise 3, when initialized to zeros for momentum
but for exercise 5, I tried several things ( np.zeros & np.shape, l instead of l+1 etc. ) I just don’t understand why it doesn’t work at all.

2nd question
vdW is initialized to zeros, then isn’t 𝛽𝑣𝑑𝑊[𝑙] zero for all the equations?
To think of the meaning that momentum in taking previous value (vdW) account into the current value, doesn’t zero initialization makes it vain?

I just found out that it was simply a matter of indentation… Feeling very foolish.

But if you could give me some hints for my question 2, it would be very grateful.

Yes, I was going to say that the error message seems pretty clear there :nerd_face:

For Question 2, the point is that db^{[l]} is non-zero, so that means v_{dW^{[l]}} is only zero for the first iteration, right? It’s basically an EWA for db and that’s how EWAs work, although you have the option of doing the “bias correction” at the beginning, but they choose not to do that here.

1 Like