Hi all,
I know that I am not the first one to encounter this issue and looked at all other topics on the same subject but I have not found the solution to my problem and I am stuck. My conv_forward() function results in an error:
Z’s mean =
-0.0703046153084542
Z[0,2,1] =
[0. 0. 0. 0. 0. 0. 0. 0.]
cache_conv[0][1][2][3] =
[-1.1191154 1.9560789 -0.3264995 -1.34267579]
(2, 13, 15, 8)
Error: Wrong output for variable in position 0.
2 Tests passed
1 Tests failed
(…)
AssertionError: Not all tests were passed for conv_forward. Check your equations and avoid using global variables inside the function.
Z[0,2,1] should certainly not contain only zeros. I am not sure of the slicing and did my for loop like this:
for i in range(m):
a_prev_pad = A_prev_pad[i]
#print(a_prev_pad)
for h in range(n_H-2):
vert_start = h*stride
vert_end = (h+1)stride
for w in range(n_W-2):
horiz_start = wstride
horiz_end = (w+1)*stride
for c in range(n_C):
a_slice_prev = a_prev_pad[vert_start:vert_end,horiz_start:horiz_end,:]
weights = W[vert_start:vert_end,horiz_start:horiz_end,:,c]
biases = b[0,0,0,c]
Z[i,h,w,c]=conv_single_step(a_slice_prev, weights, biases)
Can someone give me a hint ?