Locally connected layer (convolution with different weights for each location)

Hi, I wonder if I can implement a convolution layer that uses different parameterization for each location. It might be called a locally connected layer instead of a fully connected one.

Is there any way to implement it?

Thanks,
Paul

3 Likes

It’s dearly missed, but can be hacked together… I’m not sure on the most efficient way though, I’ve seen several “solutions” to this.

For example, I use this method straight from the backend:

arguments: input, weight, bias, kH, kW, strideH, strideW, padH, padW, inH, inW, outH, outW
conv2Dlocal = torch.nn.backends.thnn.backend.SpatialConvolutionLocal.apply

I find it strange there is still no supported solution for this (should easily be in the functional sub-lib at least).

2 Likes