Non-square Filters and Separated Stride and Padding

*Note this is a work in progress and I need to double-check the indices and add new tests.*

Accept pairs of height/Y and width/X values for kernel size, stride, and pad in lieu of a single, shared value.

Of course the square/equal case still works and the old defaults (stride = 1 and padding = 0) are kept.

Open to comments on implementation and style. In particular, the pairs of variables feel awkward and I might switch to `std:pair`.
Agreed. I've added these checks.

Le mardi 17 juin 2014, Jeff Donahue <notifications@github.com> a écrit :

> In src/caffe/layers/im2col_layer.cpp:
>
> > @@ -13,15 +13,28 @@ template <typename Dtype>
> >  void Im2colLayer<Dtype>::SetUp(const vector<Blob<Dtype>*>& bottom,
> >        vector<Blob<Dtype>*>* top) {
> >    Layer<Dtype>::SetUp(bottom, top);
> > -  kernel_size_ = this->layer_param_.convolution_param().kernel_size();
> > -  stride_ = this->layer_param_.convolution_param().stride();
> > -  pad_ = this->layer_param_.convolution_param().pad();
> > +  ConvolutionParameter conv_param = this->layer_param_.convolution_param();
> > +  kernel_height_ = conv_param.kernel_size(0);
>
> should probably CHECK_GT(conv_param.kernel_size_size(), 0) first. Also CHECK_GT(kernel_height_
> * kernel_width_, 0) after setting those -- we should have had a similar
> check all along really (since kernel_size defaults to 0).
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/BVLC/caffe/pull/505/files#r13839327>.
>