Course 2 week2 Optimization_methods Wrong values for s['dW1']

I’m getting Wrong values. Check you formulas for s['dW1'] error for Exercise 6 - update_parameters_with_adam

above all test passed.

What is the Exercise 1 Expected values:

my was start with : W1 = [[ 1.63312395 -0.61217855 -0.5339999 ] [-1.06196243 0.85396039 -2.3105546 ]]

I re-cheked formula and I try few option for taking of power but I got same error for Exercise 6 .

Can you share the screenshot of your error? with week mention and assignment name

ok your error log shows your dW1 code is not correct and you need to use np.ndarray. go back to previous cells and notice if you have missed anything

Is it my zero vectors wrong. I can’t notice anything. I tried np.zeros[a].shape and np.zeros_like[a] methods.

Can you share the code for the particular cell you are having issue, share it in personal DM. Do not post code on public post as it is against community guidelines. Click my name and then message.


Have you passed the random_mini_batches_test??

s_corrected[“dW” + str(l)]=s[“dW” + str(l)] = s[“dW”+str(l)]/(1-np.power(beta2,t))
s_corrected[“db” + str(l)]=s[“db” + str(l)] = s[“db”+str(l)]/(1-np.power(beta2,t))

why these extra parameters?? with = remove those extra s[dw+str(l)] = from both equation

I hope you have not copy-paste code.


In your parameters code where you divide v_corrected with s_corrected, you needed to use / and you have used \ do that correction.

does the exercise cell pass now?

Ops, I was coping in # s_corrected["dW" + str(l)] = ... in code block. I guess I copied twice.

Now fixed. I was focusing dw1 and previous code block. I didn’t notice. I guess I should quit copy paste. :face_with_hand_over_mouth:

Thanks Deepti!

That’s okay, we all do such mistakes especially when we have many codes to write and that is how we learn. Patience is the key.

Keep learning!!!


1 Like