Exercise 3: initialize_parameters grad is 9/10

Hey guys!
I just finished the week 3 lab and got the grade in Exercise 3: initialize_parameters.
However, I don’t know what I could have gone wrong, the question doesn’t have many steps. As I call question 3 in question 7, I also got a lower score.
Anyway, to initialize the parameters and just get the X and Y shapes and set n_h to two, has anyone had a similar problem?

image

1 Like

Hi! Can you please doublecheck the function to generate the random numbers? You should use np.random.randn and not np.random.rand.

If it’s not the case, please let me know.

1 Like

Wow, Lucas! It was accurate.
I wrote the resolution and forgot a letter in the parameter W2. I read the solution several times and did not understand hahaha.
But now it works, thanks!

Hello though I am using np.random.randn I have the same problem and fails the exercise, is there something I am missing?

Hi!
In my case, in the parameter w1 I used randn and in w2 I used (wrongly) rand. As for the b1 and b2 parameters, I used the correct np.zeros. Try putting the output of your code, I believe it helps to find out the root cause.

1 Like

+1 to the thread here! I also had “randn” for W1 but “rand” for W2. Changing both to use “randn” passes the checker.