My code produces the expected results for everything except W1 which is slightly off. Oddly, the results for W2 are correct even though the code is the same – just a different iteration through the same loop. I am getting error messages for

"wrong type of “v_corrected[’{key}’]. Expected np.ndarray” and

“Wrong shape for v_corrected[’{key}’]. The update must keep the dimensions of v inputs”

Yet, adding print statements reveals that *ALL* keys of v_corrected are of type np.ndarray

and *ALL* keys of v_corrected have the same dimensions as v.

I am also getting an error message saying that v_corrected[‘dW1’] has incorrect values.

The two relevant lines of code are as follows.

```
v[ "dW" + str(l) ] = beta1 * v[ "dW" + str(l) ] + (1-beta1) * grads[ "dW" + str(l) ]
v_corrected[ "dW" + str(l) ] = v[ "dW" + str(l) ] / (1 - math.pow(beta1,l) )
```

What on earth could be going on? Why does this work for iteration l =2 but not for iteration l = 1?