DLS Course 4, Week 1, Global Variables Assertion Error

Hi,
I’m getting the following Assertion Error when I was working on the first programming exercise of Week 1 in DLS4:
AssertionError: Not all tests were passed for conv_forward. Check your equations and avoid using global variables inside the function.

Here’s my output from the conv_forward_test(conv_forward):
Z’s mean =
0.5329033220060434
Z[0,2,1] =
[-0.05723279 0.03991888 -6.24285862 0.53960581 -5.04059676 6.96991358
3.69509379 -0.20955895]
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

I can’t seem to find the error. Any help would be greatly appreciated.

Thanks,
Nay

Your Z values are incorrect.
Your cache and shape values are OK.

Hey, @TMosh. I get the exact same result as Nay. For the life of me I can’t figure out what’s wrong, any other tips you can share?

Edit: doing a little digging (for others stumbling on this question), you might want to consider the stride in your loops

Most likely, either the a_slice_prev, weights, or biases values are incorrect.

a_slice_prev is probably the most tricky, because it requires you have the correct values for the horiz and vert start and end.

1 Like