Value | Meaning |
---|---|
ANEURALNETWORKS_PADDING_SAME1 | SAME padding. Padding on both ends are the "same": padding_to_beginning = total_padding / 2 padding_to_end = (total_padding + 1)/2. i.e., for even number of padding, padding to both ends are exactly the same; for odd number of padding, padding to the ending is bigger than the padding to the beginning by 1. total_padding is a function of input, stride and filter size. It could be computed as follows: out_size = (input + stride - 1) / stride; needed_input = (out_size - 1) * stride + filter_size total_padding = max(0, needed_input - input_size) The computation is the same for the horizontal and vertical directions. |
ANEURALNETWORKS_PADDING_VALID2 | VALID padding. No padding. When the input size is not evenly divisible by the filter size, the input at the end that could not fill the whole filter tile will simply be ignored. |
Implicit padding algorithms.