Course 2, Regularization Assignment, Exercise 3

Hi All!

If anyone could help on this it would be greatly appreciated. My assignment grade is stuck on 60% due to my results on this exercise. I have gone over it many times and fail to see how my code is incorrect.

When I run the test cases, I am informed 1 is passed while 1 fails. There is little cue as to how it is failing and I believe my solution to be correct.

Below is the exercise with my code added in. Any feedback would be great. Thanks!

{moderator edit - solution code removed}

You are using the wrong PRNG function for computing the masks. You are using the Gaussian distribution with \mu = 0 and \sigma = 1. That’s not what the instructions say. :nerd_face: Have a look at the comments in the template code.

1 Like

Great, thank you! Not sure how I didn’t spot that when going over it… I’m blind :upside_down_face:

If it’s any comfort, you are far from the first person to step on that landmine. Up to this point in DLS C1 and C2, we’ve literally never seen np.random.rand before, only np.random.randn. But that little n on the end there changes everything. :nerd_face: