EasyDeepLearn

SAME vs VALID vs REFLECT padding — what are the practical differences?

easy

Answer

  • VALID = no padding (output shrinks each layer).
  • SAME = pad zeros so output has same H, W as input for stride 1.
  • REFLECT = pad by reflecting pixels near the boundary (avoids the 'black-edge' artifacts you get with zero-padding in segmentation / super-resolution).
  • REPLICATE = pad by repeating the edge pixel.
  • Choice matters for boundary quality: SAME/zero is fine for classification, REFLECT/REPLICATE for dense prediction.
Check yourself — multiple choice
  • All padding modes are identical
  • VALID = no pad; SAME = zero-pad; REFLECT/REPLICATE = avoid edge artifacts (useful for dense prediction)
  • Only VALID exists
  • REFLECT increases receptive field

REFLECT/REPLICATE keep edge quality — matters for segmentation / super-resolution.

#cnn

Practise Deep Learning

214 interview questions in this topic.

Related questions