C2, W2, a question about update_parameters_with_momentum

{moderator edit - solution code removed}

In the function initialize_velocity(),we’ve initialized v to v[“dW1”] =[[0. 0. 0.][0. 0. 0.]]…,which means that “v[“dW” + str(l)] = beta * v[“dW” + str(l)] + (1 - beta) * grads[“dW” + str(l)]” is equal to “v[“dW” + str(l)] = (1 - beta) * grads[“dW” + str(l)]” or we’ve just scaled V a little bit use (1 - beta). However, I think the equation should look something like this ”Vdw(l) = beta * Vdw(l-1) + (1 - beta) * dw"

Maybe I’m missing your point, but the velocity is only 0 for the first iteration, right? The point is that it gets updated every time you call the update routine.