same padding
时间: 2023-11-13 17:27:47 浏览: 69
pytorch padding='same'
Same padding is a technique used in convolutional neural networks (CNNs) to preserve the spatial dimensions of the input volume or image after convolution. It involves adding zeros to the input volume or image so that the output volume or feature map has the same size as the input. This is achieved by calculating the amount of padding needed for each axis of the input such that the convolution operation does not reduce the spatial dimensions.
For example, if we have a 5x5 input image and we apply a 3x3 filter with a stride of 1 and no padding, the resulting output feature map will have dimensions of 3x3. However, if we add one layer of padding around the input image, the resulting output feature map will also have dimensions of 5x5. This is because the padding has effectively expanded the input image to 7x7 before applying the convolution, resulting in an output feature map with dimensions equal to the input image.
阅读全文