C4W3 Transpose Convolutions Video

Shouldn’t the output be of form 3X3?? (for stride=2 and padding=1)

I believe you are referring to Course 4 Week 3 (not “C3W4”) starting around time mark 2:02.

It seems to me that the video is correct.

Hi @DeepakSivala,

Let’s consider the convolution (3x3 kernel, stride = 2, padding = 1) for two cases: (i) 3x3 input, (ii) 4x4 input. In these cases, both result in a 2x2 output.

Therefore, when we apply the transpose convolution to a 2x2 input, it should be possible to produce either a (i) 3x3 output, or a (ii) 4x4 output.

The lecture assumed a 4x4 output.

The default Pytorch ConvTranspose2d gave you a 3x3 output, but you might set its parameter output_padding = 1 to get the 4x4 output.

Cheers,
Raymond