nitorch icon indicating copy to clipboard operation
nitorch copied to clipboard

Convolution with boundary conditions

Open balbasty opened this issue 4 years ago • 0 comments

PyTorch's convolutions return domain is the joint domain of the input tensor and kernel. This means that the tensor is implicitly cropped by an amount that corresponds to the kernel size. Furthermore, padding mode other than zero trigger an allocation.

I propose to implement a nitorch-specific convolution that is more in-line with the behaviour of spm's vel2mom, where the output domain is the same as the input domain (up to strides), and boundary conditions are handled on the fly. Such an implementation cannot use CuDNN, so will be slower than PyTorch's version, but will make gradient-based regularisers easier to implement.

This feature is in active development in banch conv.

balbasty avatar Jun 09 '20 16:06 balbasty