DLS C4/W1/A1: Ex3 - conv_forward

Hello DeepLearners,

I got stuck in the DLS Course 4, Week 1, Assignment 1, Exercise 3, “conf_forward” and looking for some advice.

My code fails calling the conv_forward_test() method in public_tests.py in the section of # Test 1.
In contrast to the case specified in the listing [57] in the notebook, which I will refer to as “Test 0”, Test 1 increases the padding from 1 to 3 and reduces the stride from 2 to 1. Other parameters remain the same as for Test 0.

I observed that Test 0 runs fine, but Test 1 fails with the ValueError: ValueError: operands could not be broadcast together with shapes (3,2,4) (3,3,4)

To be more precise, this occurs processing the slice with the corners (0, 3, 5, 8) assuming ( vert_start , vert_end , horiz_start, horiz_end).
Thus, it seems to me that the (3D) slice a_prev_pad of the training example 0's padded activation has the wrong shape.
I assume that instead of (3,2,4), the shape should rather be (3,3,4)?

Any suggestions?

I just found the bug:

I used the unpadded A_prev to select the ith training example’s padded activation, which must be the padded version A_prev_pad.