When I do a conv2d step, how do I pad my images (spatially) symmetrically as done for example in Caffe and cuDNN, as opposed to Tensorflow's implementation:
From Tensorflow Convolution Docs:
Note that the division by 2 means that there might be cases when the padding on both sides (top vs bottom, right vs left) are off by one. In this case, the bottom and right sides always get the one additional padded pixel. For example, when pad_along_height is 5, we pad 2 pixels at the top and 3 pixels at the bottom. Note that this is different from existing libraries such as cuDNN and Caffe, which explicitly specify the number of padded pixels and always pad the same number of pixels on both sides.
Question: How do I use (or hack) Tensorflow in a way that it conforms to the way cuDNN or Caffe does it? I do not want to introduce individual performance-hitting calls tf.pad()
, preferably.
Note this is not the same question as posed here: Custom padding for convolutions in TensorFlow