Understanding the size of the image
From Chap 14; I’m looking at the summary of the Model produced from
def _resnet_stem(*sizes):
return [
ConvLayer(sizes[i], sizes[i+1], 3, stride = 2 if i==0 else 1)
for i in range(len(sizes)-1)
] + [nn.MaxPool2d(kernel_size=3, stride=2, padding=1)]
....
stem = _resnet_stem(3,32,32,64)
The summary starts with:
============================================================================
Layer (type) Output Shape Param # Trainable
============================================================================
128 x 32 x 112 x 112
Conv2d 864 True
BatchNorm2d 64 True
ReLU
Conv2d 9216 True
BatchNorm2d 64 True
ReLU
____________________________________________________________________________
128 x 64 x 112 x 112
Conv2d 18432 True
BatchNorm2d 128 True
ReLU
MaxPool2d
Conv2d 4096 True
BatchNorm2d 128 True
ReLU
Conv2d 36864 True
BatchNorm2d 128 True
ReLU
I think the Output Shape
shows the shape which the layer immediately below it outputs, when it changes the shape from the above layer.
Looking at layer_info
it only tracks the shape for Layers with “weights”; and so it doesn’t record the change in shape that MaxPool2d
creates.
Is this expected behaviour of summary
?