Course 2 week 1 PA 2

hello,
D1 = np.random.randn(A1.shape[0], A1.shape[1])
D1 = (D1 < keep_prob).astype(int)
A1 = A1 * D1
A1 = A1 / keep_prob
D2 = np.random.randn(A2.shape[0], A2.shape[1])
D2 = D2 < keep_prob
A2 = A2 * D2
A2 = A2 / keep_prob
A3 = [[0.49683389 0.05332327 0.04565099 0.01446893 0.49683389]]
1 Tests passed
1 Tests failed
AssertionError Traceback (most recent call last)
in
4 print ("A3 = " + str(A3))
5
----> 6 forward_propagation_with_dropout_test(forward_propagation_with_dropout)

~/work/release/W1A2/public_tests.py in forward_propagation_with_dropout_test(target)
166 ]
167
→ 168 multiple_test(test_cases, target)
169
170 def backward_propagation_with_dropout_test(target):

/opt/conda/lib/python3.7/site-packages/dlai_tools/testing_utils.py in multiple_test(test_cases, target)
162 print(’\033[91m’, len(test_cases) - success, " Tests failed")
163 raise AssertionError(
→ 164 “Not all tests were passed for {}. Check your equations and avoid using global variables inside the function.”.format(target.name))

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

Hi @uzaif , the exercise asks to use np.random.rand() and you are using np.random.randn(). It’s the difference between using a unified distribution vs a normal distribution for creating the d-variable. Hope this helps.