Hello,
I am having a problem with my code in conv_forward function where it is passing conv_forward_test2 but not test 1, please see the output below, somehow when i use the common part for calculating vert_start ,vert_end etc from this code in the pool_forward assignment it passes the test. Any pointers would be helpful as i have been stuck with only this function since some time now. I have pasted error below.
regards
np.random.seed(1)
A_prev = np.random.randn(2, 5, 7, 4)
W = np.random.randn(3, 3, 4, 8)
b = np.random.randn(1, 1, 1, 8)
hparameters = {“pad” : 1,
“stride”: 2}
Z, cache_conv = conv_forward(A_prev, W, b, hparameters)
z_mean = np.mean(Z)
z_0_2_1 = Z[0, 2, 1]
cache_0_1_2_3 = cache_conv[0][1][2][3]
print(“Z’s mean =\n”, z_mean)
print(“Z[0,2,1] =\n”, z_0_2_1)
print(“cache_conv[0][1][2][3] =\n”, cache_0_1_2_3)
conv_forward_test_1(z_mean, z_0_2_1, cache_0_1_2_3)
conv_forward_test_2(conv_forward)
Z’s mean =
0.02834256615145314
Z[0,2,1] =
[-0.91364906 -5.93941251 6.39191803 5.55329522 -2.32821606 2.86099341
-0.83017133 1.36532492]
cache_conv[0][1][2][3] =
[-1.1191154 1.9560789 -0.3264995 -1.34267579]
First Test: Z’s mean is incorrect. Expected: 0.5511276474566768
Your output: 0.02834256615145314
First Test: Z[0,2,1] is incorrect. Expected: [-2.17796037, 8.07171329, -0.5772704, 3.36286738, 4.48113645, -2.89198428, 10.99288867, 3.03171932]
Your output: [-0.91364906 -5.93941251 6.39191803 5.55329522 -2.32821606 2.86099341
-0.83017133 1.36532492]
Second Test: All tests passed!