Exercise 4 - w4_unittest.test_initialize_model

Not sure if I’ve got this wrong or if there is an error in unittest. For test_initialize_model, I’m pretty sure I’ve got the shapes and random generation right for W1, W2, b1, and b2. I also didn’t touch random_seed, so I don’t think the random_seed is the issue. Can someone please test if test_initialize_model has the correct expected values?

If there is an error in test_initialize_model, then I think this same problem carries forward into test_gradient_descent since test_gradient_descent also calls the test_initialize_model function.

Hi @William_Lit,

I doubt there is an error in the unit test.

I’ll DM you regarding this.

Best,
Mubsi

1 Like

Hi @Mubsi - thanks for the quick response. Sent you back an email with the response. Please let me know if there are any other questions!

Hi @William_Lit,

After taking a look at your Ex 1, I noticed you were using randn function, when you are asked to use the rand function. That was the only thing causing the unit test to fail.

Keep learning,
Mubsi

Thanks @Mubsi! Problem was in user literacy, not unittest! Appreciate the quick response. You guys are awesome!

1 Like