I currently tried to figure out which paddings are directly supported by the frameworks:

Tensorflow (tf.nn.conv2d):

  • padding='VALID': No padding
  • padding='SAME': 0-padding such that the output has the same size as the input

By applying tf.pad and then padding='VALID' one can get reflect and symmetric padding.

Lasagne (lasagne.layers.Conv2DLayer) (and probably also Theano):

  • pad='full': A variant of 0-padding which results in a bigger image
  • pad='same': Like SAME for TF
  • pad='valid': Like SAME for TF

Caffe (docs): I have no idea which padding they support. As pad_h and pad_w seem to be in convolution_param, I guess padding is supported. Probably (only?) zero-padding.

Hence my question:

Are there publications where CNNs with padding, which was neither VALID nor SAME, or not 0-padding, was used?

For example, I know of the following other options:

  • reflect
  • nearest

both of them might have the advantage, that the filter does not detect a border, where no border is.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.