Week1 Regularization Assignment - forward_propagation_with_dropout() error

when I execute this function , I get 1 Test passed , 1 Test Failed. After checking code 3-4 times I didn’t understand the error.Please help

AssertionError: Not all tests were passed for forward_propagation_with_dropout. Check your equations and avoid using global variables inside the function.

I have the same problem. I get the wrong output for variables in position 0, 1, 2, 5, 6, 7, 10 and 11. I also cannot find what went wrong.

check ,you initialize matrices as explicitly explained

@Leanne had the exact same problem. I’m posting a link to the following thread in case it helps other learners:

Good luck with the rest of the course, @yash_3 :slight_smile:

2 Likes

Thanks a lot @nramon. So the instruction asked us to use uniformly distributed random numbers (np.random.rand), and I missed that. Due to muscle memory I was also using gaussian distributed random numbers (np.random.randn). I need to get my eyes checked :slight_smile: I had been staring at the instruction for hours, but still failed to see my mistake. Your post really helped steer me in the right direction.

1 Like

@yash_3 how did you solve this issue ?.Am stuck with same error
AssertionError: Not all tests were passed for forward_propagation_with_dropout. Check your equations and avoid using global variables inside the function.

Fixed by @gkimatu.

To initialize D1 and D2, call np.random.rand with the appropriate arguments. Nothing else needs to be done in step 1.

Good luck with the rest of the course :slight_smile: