8
$\begingroup$
conv = conv_2d (strides=)

I want to know in what sense a non-strided convolution differs from a strided convolution. I know how convolutions with strides work but I am not familiar with the non-strided one.

The given convolutional function is from tflearn, should i just set it to zero or something else?

I am trying to implement pilotNet which I found here.

$\endgroup$
0

5 Answers 5

12
$\begingroup$

Stride is the distance between spatial locations where the convolution kernel is applied. In the default scenario, the distance is 1 in each dimension. This is also the default value in Tensor Flow, as @Axel Vanraes mentions.

I suppose this is sometimes referred to as non-strided convolution, although that is incorrect: the stride is one. When the stride is larger than one, one usually talks about strided convolution to make the difference explicit.

To visualize the difference:

  • Stride-1 convolution ("non-strided"):
  • Stride-2 convolution ("strided"):

Images from https://github.com/vdumoulin/conv_arithmetic

$\endgroup$
1
$\begingroup$

There's always a stride. The whole idea of convolution is that you stride the window over the input vector, matrix or tensor otherwise.

Stride parameter tells you the length of the step in your stride. By default it's probably 1 in any framework. You can increase the stride (step) length in order to save space or cut calculation time. You'll be foregoing some information when doing so, it's a trade-off between resource consumption (whether it's CPU or memory) and information retrieved.

$\endgroup$
0
$\begingroup$

Applying convolution means sliding a kernel over an input signal outputting a weighted sum where the weights are the values inside the kernel. The stride is the sliding step. You can not have a stride of 0, this would mean not sliding at all. In the paper they use a convolution with a 2X2 stride, the step is 2 in both x and y direction, followed by non-strided convolution, stride 1, step 1. You can observe from fig2 from the paper that the output of a convolution with stride 2 halves the width and height of the input (first 3 conv layer) whereas the output of a convolution with stride 1 (last 2 conv layers) has width = input_width-2 and height = height-2 because the kernel is 3x3.

$\endgroup$
0
$\begingroup$

First of all, there is no such thing as a non-strided convolution. Using the low-level API, the following statement will give an error because every element in strides argument must be greater than zero!

y = tf.nn.conv2d(x, strides=[1, 0, 0, 1]) # error !
y = tf.nn.conv2d(x, strides=[1, 1, 1, 1]) # OK

Note that the first (=sample index) and the last (=channel) dimension must equal to one.

Secondly, when using the TF Layers API, the strides argument has a default value:

tf.layers.conv2d(
    inputs,
    filters,
    kernel_size,
    strides=(1, 1), 
    ...

Note that there are only two entries in the strides tuple which correspond to the second and the third entry in the Layers API. The first and the last dimension are dropped.

So if you haven't set the strides argument, the convolution filters will move with of one pixel by default and I suppose this is what they mean with non-strided convolutions in the paper.

$\endgroup$
3
  • $\begingroup$ Did you mean that it is not what you want? The sentence using the "with of:" is not proper English. You probably mean "will move just one pixel at a time". $\endgroup$ Commented Aug 6, 2018 at 13:42
  • $\begingroup$ Sorry, that was a typo. I edited the post and hopefully it is clear now. $\endgroup$ Commented Aug 7, 2018 at 14:54
  • $\begingroup$ + I think default strides = [1, 1, 1, 1] in TFLearn should be fine in your case $\endgroup$ Commented Aug 7, 2018 at 14:55
0
$\begingroup$

These are absolutely standard names. There is a nice description of the standard meaning of these terms here: https://cs231n.github.io/convolutional-networks/

Which is to my knowledge is the best description. If a link will disappear for 3 years please just type CS231N in Google.

p.s. Unfortunately, not all people during publishing append Glossary into scientific papers and papers about some practical modeling technics (written not in a way how classical scientist is working, but still it's useful).

As you see the document that you have shared looks like a paper, but really it's too bad paper for publishing it does not contain Glossary Term, experimental section, theory, limitations of the solution, future work, complete experimental setup...

People in my academic field (Optimization) have another style of publishing: https://arxiv.org/abs/2102.07845

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.