W : the width of the input feature map, H : the height of the input feature map
K : kernel size convolution kernel width and height, P : padding (the number of 0s that need to be filled in the feature map ), S : stride step size
width_out : the width of the output feature map after convolution, height_out : the height of the output feature map after convolution
Ordinary convolution
Calculation formula:
width_out = (W - K + 2 * P) / S + 1 (rounded down)
height_out = (H - K + 2 * P) / S + 1 (rounded down)
pooling
Calculation formula:
width_out = (W - K) / S + 1 (round down)
height_out = (H - K) / S + 1 (rounded down)
Upsampling UpSampling2D
Upsampling is equivalent to how many times to enlarge , size=multiple
Calculation formula:
width_out = W * size
height_out = H * size
transposed convolution
Transposed convolution, commonly known as deconvolution, is one of the upsampling methods. Transposed convolution is used to increase the resolution of the feature map.
Calculation formula:
width_out = (W - 1)* S - 2 * P + K
height_out = (H - 1)* S - 2 * P + K