Doubt in calculating output shape of convolution operation

I’ve 2 doubts in the official formula for calculating shape of output after applying 2d convolutional operation :

  1. Why do we add 1 and take floor, why don’t just take ceiling ?
  2. Why do we add 1 in the numerator ?
  1. floor + 1 is different to ceil for the case of a zero, which is needed in the calculation:
    floor(0) + 1 = 1, while ceil(0) = 0

  2. We subtract 1 in the numerator. Have a look at the Conv arithmetic to derive the formula. Basically if you reformulate the dilated conv output shape formula, you’ll get to the one used in the PyTorch docs.

1 Like