While trying to use Tensorflow I encountered a little problem regarding the stride.
I have an image of size 67*67, and I want to apply a filter of size 7*7 with stride 3. The output layer should have an edge length of 20 calculated from:
Where n is the output layer edge length (in this case, 20). It is calculated in the follow way:
If we only consider the first row (since other rows are the same), then out of the 67 elements in the first row, the first 7 would go to the first cell of the output layer. Then the filter moves 3 element to the right, which makes the filter covering element 4 to 10, and that would correspond to the 2nd element of the output layer. So on so forth. Every time we advance 3 elements and the total number of times we will advance (counting the first step where it covers 7 elements) is n. Thus the equation I used.
However, the output layer I got from Tensorflow was 23, which is 67/3 and rounded up to the next integer. I don't understand the reasoning behind this.
Can someone explain why it is done like this in Tensorflow?
Thanks!