No Stride Possible ?

25 views
Skip to first unread message

par...@unlv.nevada.edu

unread,
Jan 18, 2017, 5:34:15 PM1/18/17
to Caffe Users
 I am trying to use filters without any stride, so, filters would be applied to a fixed position on the image. Also, the fixed position is such that the center of filter should coincide with the center of image.
 
 Is it possible to do this in Caffe ?

par...@unlv.nevada.edu

unread,
Jan 18, 2017, 5:44:46 PM1/18/17
to Caffe Users
 Is it possible to do with 'group' option ? I am not sure if channels, in group options, means pixels.

Hieu Do Trung

unread,
Jan 19, 2017, 5:44:31 AM1/19/17
to Caffe Users
You just declare the kernel size equal to the size of the image.
AlexNet has the filter size of 11x11.
If your images has size like 256x256, just declare kernel size with that size.
Regardless of the stride, since the kernel and the image are the same, the filter is applied to the image just once.

Przemek D

unread,
Jan 19, 2017, 5:48:52 AM1/19/17
to Caffe Users
Perhaps by a cropping layer? Or with a filter of size equal to image size?

Group option is something entirely different, relating to number of filters in a conv layer. If you have num_output equal to 10, it means you convolve your input blob with 10 individual filters, since group param is 1 by default, meaning you only have 1 group of kernels. However, if you set group to 2, you no longer have 10 kernels, but 2 groups of 5 kernels - this reduces the number of weights in your layer. It's as if you split your input into 2 layers, convolved them with a conv layer with 5 outputs and concatenated the result. Set group and num_output to the same value, and effectively you're convolving your input with 1 kernel, each input channel individually (used in deconv upscaling, for example).

par...@unlv.nevada.edu

unread,
Jan 19, 2017, 7:45:49 PM1/19/17
to Caffe Users
 That's what I was looking. Thanks a lot!

par...@unlv.nevada.edu

unread,
Jan 19, 2017, 7:50:36 PM1/19/17
to Caffe Users
It seems that using a filter of the same size as image would be better for my case. However, as you said, cropping would be useful if only a small patch of the whole image is to be used. Thanks for the suggestions and the clarification about 'group' options.
Reply all
Reply to author
Forward
0 new messages