Convolution three modes: Calculated full, same, valid + size of the convolution output

Transfer from https://blog.csdn.net/u012370185/article/details/95238828

When convolution is usually carried out by external api, it will face mode selection.

These three mode differences: different restrictions on the movement range of the convolution kernel.

Set image size is 7x7 (orange part), filter size is 3x3 (blue)

1. full mode

full mode: From the intersection of filter and image just started doing convolution, lack of parts padding 0. filter range of motion as shown in FIG.

 

2. same mode

same mode: same pattern does not mean exactly the same size as the input and output (via code verification), the step also has a relationship with the convolution kernel.

same pattern is the most common mode refers to the map through the features and original convolution of size remains unchanged.

 

3.valid mode

When all of the image inside the filter when the convolution operation, the movement range of the visible filter is smaller than the same.

 

 

4. FIG calculated size of the convoluted

First define several parameters

  • Input picture size  W × W
  • Filter size  F × F
  • Step  S
  • padding the number of pixels  P

So we can draw

N = (W − F + 2P )/S+1

Image output size N × N

Guess you like

Origin www.cnblogs.com/scarecrow-blog/p/11804306.html