is there a way to skip/mask a particular row/column or even pixel of the input in a Conv2D layer?
Further, is it possible to skip/mask only the backward pass?
An example:
Given an input with (h,w)=(10,10) e.g. the 5th row should be ignored, so that the output size after appropriately padded convolution is (h,w) = (9,10).
Thanks, but the row/column/pixel is needed for the convolution of neighboring rows/columns/pixels. It just should not produce an output where it’s at the center of the convolution kernel (especially not on the backward pass)
Yes kind of.
I need those pixels in the forward pass, but when the kernel is centered on those pixels it (the entire kernel at that location) should not contribute to the gradient.
The masking will do what you want. As it will fill the gradient for these pixels with 0s and the backward of the conv will propagate 0 * w = 0 for these entries.