0
$\begingroup$

I feel like this question has been asked before, but I can't seem to find any old material on this.

In the convolutional layer for CNNs, when you specify the stride of a filter, typical notes show some examples of this but only for the horizontal panning. Is this same stride applied for the vertical direction too when you're done with the current row?

In other words, say our input volume is 7x7, and we apply a stride of 1 for a 3x3 filter. Is the output volume 5x5? (which would mean you applied the stride in both the horizontal and vertical panning).

Is it possible to apply a different stride for each direction?

$\endgroup$
0
$\begingroup$

Yes, in Keras this is simply implemented by using a tuple for the stride argument of a convolutional layer, with each element of the tuple corresponding to the stride of each dimension.

| improve this answer | |
$\endgroup$
0
$\begingroup$

Yes, in Keras you can apply different strides by giving a tuple/list, specifying the value of strides along the height and width. If you just give a single value the API assumes the same value for all spatial dimensions.

You can find the official documentation here

In Pytorch, too you can specify the values in a tuple for the stride argument. Link to Pytorch Documentation for stride

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.