Hey,
instead of having the padding for my Conv2d layers set to 'same' or 'valid', I'd like to have some sort of cylindrical padding, i.e. no padding to the left and right, but a periodic padding for the top and bottom.
It would be really helpful for all kinds of cylindrical problems in e.g. physics like in my case.
Is it somehow possible to get a padding option like this?
Thank you very much and best regards
What about toroidal problems, and projective plane problems :-). Are there any Klein bottle problems, and Mobius strip problems? What about helical problems (when your cylinder is glued with a shift)?
I agree that it would be nice. In practice, how you do small padding typically doesn't really matter (because the proportion of the number of pixels on the edge is typically small on most layers), and padding with zeros is a form of "occlusion regularization" (my term). Also, padding intermediate layers could be completely equivalently replaced (at the cost of efficiency) by a (much larger) padding of the input layer. You can make that experiment and report if the kind of padding actually mattered.
A much more common need BTW IMHO is 'mirror' padding.
One thing I'd like (which can't really be done currently with hacks) is spherical convolutions (rather than current planar ones).
When these features are implemented, I think most logical API would allow setting some kind of "cylindrical mode" on the whole network, because it affects not just conv layers, but also pooling, augmentation, etc. Possibly even fan_in/fan_out computations and whatnot.
You can also file Cylindrical padding feature request with TF: https://www.tensorflow.org/api_docs/python/tf/pad
I would also appreciate having doubly periodic padding for 2D convolution. This is a common scenario in physics-based models.
Most helpful comment
I would also appreciate having doubly periodic padding for 2D convolution. This is a common scenario in physics-based models.