[Week 2 - CNN] - Output calculation

Hey everyone

I was doing one of the programming assignments of week 2 on the CNN course and I was trying to get to the output volume of stage 1 of the ResNet50.

On the programming assignment I get this volume:
image
image

And I was trying to get the output volume of conv2d_142 but I keep getting 32.5 instead of 32?

I am using this formula:
image

Shouldn’t it be:

((64 + 2 * 3 - 7)/(2))+1, where 64 is the input H/W, 3 is the padding and 7 is the kernel size? Or am I using the formula wrong? How do we get to the 32 on the conv2d_142? The 64 channels I get since we’re using 64 filters,but not sure how we get to the 32

Thanks!

64 + 2 * 3 - 7 = 63, right? If you divide by 2, you get 31.5. But then you apply “floor”:

\lfloor 31.5 \rfloor = 31

Then you add 1 and you’re done, right? Those aren’t just parentheses there. :nerd_face:

1 Like

Apologies for my basic question, I was not aware that was the “floor” symbol! Learning things everyday :slight_smile: Much appreciated!