Week 1 Regularization - Forward Propagation With Dropout

Hello, I am having an error in forward propagation with dropout part of Regularization Assignment. I checked my code many times but still getting the error I posted below. One thing that caught my eye is the result I got for A3. They are all same numbers. (I already found other threads with solutions but none helped me.) Thanks!

Hello @Malik_Shavkatov,

The old trick, that almost always works for this kind of debugging, is to cross-check each intermediate step’s outcome with hand calculation. I have looked at the input parameters to the function and found them to be a bit “random”, so I am sharing some expected numbers with you for your cross-checking.

image

The exercise asks us to compute D1, A1, D2, A2 in eight steps, so you might also print your numbers and check with mine to see where starts to go wrong. Once you spot it, then go back to the instruction because a similar case seemed to be finally resolved by following the instructions.

Good luck!
Raymond

Hey Raymond,

Thank you for your reply. I found my mistake from the link you provided. My code in step 2 was wrong. It had to be D1<keep_prob… and not A1<keep_prob

Best,

I don’t think the link has even mentioned “D1” or “A1”.

Anyway, probably you could have discovered that if you cross checked the numbers. Although the intermediate variables’ values are not always provided to you like I did, the inputs to the public test are, so keep such approach in your toolbox as it is a good way to sort things out yourself.

Good luck!

You are correct, the link did not mention D1 or A1 specifically but did mention that code was incorrect. It just made me go line by line carefully checking my code after re-reading the instructions couple of times.

Best,