Diagram of spatial scale formula for 2 x 2 pooling layers. The green rectangle denotes the input image; the brown rectangle denotes the input feature map to the pooling later and the output feature map of the pooling layer is denoted by the blue rectangle. The spatial scale of the orange output entry is the union of the 4 regions marked on the input image which are corresponding to the spatial scales of the 4 neighboring input feature map entries.
The module that implements the functionalities of computing spatial scales and overlaps for different layers is spatial.py
. In order to compute the spatial
scale profile for a CNN, first, you need to construct its layer configuration list and then pass it to the process
method of spatial.py
. You can use
the ResNet-50
(the method resnet_50
in spatial.py
) as an example to create your own layer configuration.
Spatial scale profile of ResNet-50.
As of now, the spatial scale and overlap of the following layers have been added to this repo: 3x3 convolutional layer with stride 1
, 2x2 pooling layer with stride 2
, 3x3 convolutional layer with stride 2
, 3x3 pooling layer with stride 2
, 1x1 convolutional layer with stride 2
, 1x1 convolutional layer with stride 1
and dilated 3x3 convolutional layer with stride 1 and dilation rate of 2
.