lisa-lab/pylearn2 — pull request #916 by f0k (2014-05-19 16:36:27+00:00)
Title: Add support for cuda-convnet's filter groups

This PR adds support for the `numGroups` argument to the convolution routines of Alex Krizhevsky's cuda-convnet. This is a particular kind of restricted connectivity that splits up the input channels and filters into same-sized groups, than applies each group of filters to its associated group of input channels only. This is termed ["block sparse convolution" in the cuda-convnet documentation](http://code.google.com/p/cuda-convnet/wiki/LayerParams#Block_sparse_convolution_layer).

The PR also prepares the interface for supporting ["random sparse convolution"](http://code.google.com/p/cuda-convnet/wiki/LayerParams#Random_sparse_convolution_layer) via the `dColorIndices` argument to Alex's convolution routines, but does not attempt to implement it.

Finally, the PR includes a test that compares the grouped convolution results of cuda-convnet with results using theano's builtin `conv2d` op (both for the outputs and gradients). Results are close enough to infer that the two implementations attempt to compute the same thing, just with different rounding errors.

One minor thing I'm unsure about: Is the `self.dense_connectivity` field of `BaseActs` used anywhere? I've left it in for now, but it doesn't play any role in the implementation. Let me know if you'd like me to remove it or have any other concerns.

Cheers, Jan