Optimize 1x1 convolution for Network-in-Network style operation

1x1 convolution with stride 1 is a special case of Caffe matrix
multiplication convolution for which im2col / col2im transformations are
actually the identity. For this special case the memory and
transformation are skipped.

This optimizes the execution of 1x1 convolution i.e. NIN / CCCP convolutions. 

@mavenlin
It would be good to handle the case of pad=1

On Friday, September 19, 2014, longjon <notifications@github.com> wrote:

> In include/caffe/vision_layers.hpp:
>
> > @@ -96,7 +96,7 @@ class ConvolutionLayer : public Layer<Dtype> {
> >    int group_;
> >    int num_output_;
> >    int height_out_, width_out_;
> > -  bool bias_term_;
> > +  bool bias_term_, is_1x1_;
>
> Given that these variables are unrelated, perhaps their declarations
> should appear on separate lines?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/BVLC/caffe/pull/1118/files#r17817290>.
>


-- 
Sergio