Regularization homework


I’m getting an error that I’ve been unable to find its solution. This error is for the 2nd homework of the DLS Course 2, week 1 (Regularization homework). I’ve implemented the 6.1 Forward Propagation with Drop Out by:

  • Creating a Dl random matrix
  • Convert Dl to a matrix of 0s and 1s
  • Multiply Al by Dl to drop some hidden units
  • Scale Al dividing it by the keep_prob

But when I run the code, I get this:
“1 Tests passed
1 Tests failed”

I’ve gone over and over the code and can’t seem to find the problem.
Any idea on what could it be?

Thanks a lot,

Things to check:

  1. Make sure you used the correct PRNG function: rand not randn, right?
  2. Check to make sure that you implemented dropout in both layers.

Note that the first test is probably just checking the shape and/or type of your output and the second one checks the values.

1 Like

Thank you Paulin! I was using randn