C4 Assignment 1 Exercise 3 Wrong Z mean

Hi,

Appearantly my code doesn’t have anny issue concerning the dimensions, since I get an output. Yet it calculates the Z-mean somehow wrong. I can’t figure out: What kind of mistake could lead me to a calculation error?

Match in dimensions doesn’t guarantee numerical correctness. Please check your code.

That’s right but I still can not find the bug. I went over each step: computing the dimensions of CONV output, initializing Z, slicing A_prev and so on…

I must be overlooking something. In which step should I better focus on, in order to solve the problem of numerical correctness?

Sorry. I can’t comment without looking at your work.
Please click my name and message your notebook as an attachment.

1 Like

The most common mistakes here are to do with handling the stride. You need to include that in the computation of vert_start and horiz_start at each iterations of the loops.

1 Like

Thanks a lot to both of you for your help! It turns out that the problem was indeed about handling the stride.