Troubles in conv_forward (ex 3)

Hello.
I am haviing troubles at conv_forward (ex 3).
What I get is :Z’s mean =
0.14324427134934423
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]
First Test: Z’s mean is incorrect. Expected: 0.5511276474566768
Your output: 0.14324427134934423 . Make sure you include stride in your calculation

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. 0. 0. 0. 0. 0. 0. 0.] Make sure you include stride in your calculation

The logic here is pretty complex and there are lots of ways things can go wrong. My suggestion in a case like this is to first spend some time studying this thread and compare the instructions it gives to what your code is doing. Please try that and see if it sheds any light.

Since you are getting some of the Z values as zeros, one thing to look out for is that it is a mistake to include the “stride” in the ranges of the for loops over h and w. The point is that the loops are over the output space and we must touch every point in the output space. The striding happens in the input space (“A_prev”).

Hi Paul.
I managed to solve it eventually. The thread did help.
Thanks,Gilad

1 Like