Course 2 Week 2 Exercise 1 Optimization method

I doubt that why the error show the wrong value for W2. I had recheck for the formula several time but still coufused. Thanks

This test prepared two Python dictionaries. One is ‘parameters’ and the other is ‘grads’.
It looks like W1 and b1 are updated, but W2 and B2 are not. There are some possibilities.

  1. check the index. Is there any possibility that you use a fixed index (or hard coded one) in “for loop” ?
  2. check the loop itself. In the case of given testing, an iteration count should be 2. (I mean, two iteration to set W1 and b1 at the first iteration, then set W2 and b2 at the 2nd iteration.
    Simply inserting print() function helps you which dictionary entries are being updated.

From output for W1, basic structure of a formula seems to be correct. What you should do is to investigate why the W2 is not updated at the 2nd iteration.