DLS Course2 week2 Optimization method Assignment

Dear all,

I encountered 2 problems in the C2 W2 Assignment:

  1. Exercise 6: I received the error as in below. W1 and b1 are incorrect, yet W2 and b2 are correct. Can’t figure out what’s wrong. I also attached my code here for reference.

[Code removed from Moderator]

  1. 6-Model with different optimization tests - mode function: I made no change in the code and the code provided shows error in running.

Here shows the error in below:

I would very much appreciate it if anyone or TA could help with the problems. Many thanks!

Jingyao

Hey @Jingyao_Feng,
Can you please DM your notebook as an attachment to me?

P.S. - You have created this post in the wrong section. Let me move it for you in the correct section by using the little pencil icon next to the title.

Cheers,
Elemento

Thanks @Elemento,

I just DMed you my notebook. Also thanks for moving my post to the right section btw :slight_smile:

Hey @Jingyao_Feng,
The assertion error is pretty reasonable in your case. The issue indeed lies in the below lines of code:

v_corrected[‘dW’+str(l)] = v[‘dW’ + str(l)] / (1- np.power(beta1, l))
v_corrected[‘db’+str(l)] = v[‘db’ + str(l)] / (1- np.power(beta1, l))

If you carefully look at the mathematical expressions of these, you will find that you are supposed to use t and not l. l denotes the layer while t denotes the number of taken steps. Let me know if this helps.

Cheers,
Elemento