What is the difference between ‘SAME’ and ‘VALID’ padding in tf.nn.max_pool of tensorflow ?

What is the difference between ‘SAME’ and ‘VALID’ padding in tf.nn.max_pool of tensorflow ?

Asked on November 17, 2018 in Tensorflow.
Add Comment


  • 1 Answer(s)

    The difference between ‘SAME‘ and ‘VALID‘ are,

    In SAME padding, output of height and width are determine as:

    • out_height = ceil(float(in_height) / float(strides[1]))
    • out_width = ceil(float(in_width) / float(strides[2]))

    Then, In VALID padding, output of height and width are determine as:

    • out_height = ceil(float(in_height – filter_height + 1) / float(strides[1]))
    • out_width = ceil(float(in_width – filter_width + 1) / float(strides[2]))
    Answered on November 17, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.