Same padding, different results. #561
-
Was there a change in how padding is being done? I remember passing 'SAME' as an argument to padding was equivalent to [(1,1),(1,1)] when using strides of 2. Can anyone clarify please? from flax import linen as nn
import numpy as np
x = np.random.rand(1,100,100, 3)
a = nn.max_pool(x, (3, 3), strides=(2, 2), padding='SAME')
b = nn.max_pool(x, (3, 3), strides=(2, 2), padding=[(1,1),(1,1)])
print(np.mean(np.abs(a - b))) # 0.068035774 |
Beta Was this translation helpful? Give feedback.
Answered by
marcvanzee
Oct 29, 2020
Replies: 1 comment 2 replies
-
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
avital
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SAME
pads so the input and output shape are the same. Given that 100 - 33*3 = 1, it only pads 1 after each spatial dimension. Right now your padding mask inb
pads one before and one after, so I think it is doing too much padding.