Output size floor: if the boundary window is not sufficient, it will not be counted
The length of the single scroll output is determined by the length of the input, the completion of the sides, the size of the active nuclear and the length of the step.
Learning objectives and first steps2 objectives 2 first fixes
Try to do it after reading
- Calculate output dimensions after stride and padding
- Identify the difference between SAME and visible completion
Suggested first
- Thrust and Matrix Operations
- Basic neural network
Let's see if we can put a few positions on the effective nuclear power
The length of the single scroll output is determined by the length of the input, the completion of the sides, the size of the active nuclear and the length of the step. A common display symmetry completion formula is floor ((input +2 p− valid nuclear)/ s)+1. The bottom-down correction means that the last part of the window is not counted. It is not automatically added to the whole.
Enter length 6, core 3, step 2, complete 0, output floor((6−3)/2 +1 = 2. The window starting point is 0 and 2, covering [0,1,2] and [2,3,4]; Location 5 is not used by any window. If miscounted to 3, it would be assumed that there is an incomplete window at the end.
Enter padding1 on both sides, output floor((6+2−3)/2+1=3. The windows contain boundary completions, but they are clearly added data locations. Different frame SAME synonyms may be added to asymmetrically by the output of the target and cannot be added SAME They're always replaced by a fixed one. p 。
High and wide calculations, respectively
Two-dimensional input is 6 dimensions, 3 x 3, 2 steps long, unsupplied, and output is 3 dimensions 2. If one axis is calculated and copied to the other, the non-square image is mistakenly transformed into a square feature. dilation makes the effective nuclear material larger and needs to be pre-calculated.
Data enhancement crop sizes may change output shape, which in turn affects full connection head or feature alignment. If the model is tested at one size, it may be exposed only if it is replaced by another image scale. Each window can be listed at the beginning of a small non-square input and the boundary can be verified.
The padding value is semantic as well. Zero completion introduces manual values at the border, while different rules apply to reflectation or copy completion; The same shape does not mean the same output. The location of the partition and detection that requires precise spatial alignment also affects the coordinates centre.
This section is based on D2L and the volume arithmetical originals, and the given length is synthetic hand-counting. Actual API may have ceil_mode or a specific padding option, and pool and volume cannot be applied without reconciliation to the same boundary rule.
Value recovery
output=lambda n,k,s,p:(n+2*p-k)//s+1assert output(6,3,2,0)==2assert output(6,3,2,1)==3How can the output be two instead of three?
Only complete windows are allowed, and the third starting point 4 will cross the end, with only two after being pulled down.
When you enter 7x6 can you count only high and assume output is the same wide?
No, the two axes are calculated separately, with an output of 3 x 2.
If the image size comes from scaling, the rounding rules are also recorded. The short edge of the target is down to the integer number, which may result in different end positions from the direct assignment of a high width. Subsequent coordinate mapping should be in physical size and not dependent on nominal scaling.
Sources and reconciliations
Definitions, methods and interfaces are available.
Figures and calculations are reorganized according to this chapter. Mathematical measurements, framework operations and real business effects are described separately in the body of the text.