Regularization Week 1

I do not get one thing in working assignment of Regularization Week1 that why are we using np.random.rand() in place of np.random.rand() . As much i knew rand() is for uniform distribution where we will have issues normally as due to steep increase and sudden decrease in gradient. Why dont we used np.random.randn() in place of that.

Hi, @duke_786.

In forward_propagation_with_dropout you are generating a mask of 1’s and 0’s to shut down neurons with a certain probability.

To put it simply, if you replace np.random.rand with np.random.randn you’ll be generating more 1’s than you intended (here’s the reason).

You could adjust the expression to get the right percentage of 1’s with np.random.randn, by the way. It’s just not as straightforward as using np.random.rand.

Good luck with the assignment :slight_smile: