The code implementation of the left_pool does not correspond to the source code
SWHL opened this issue · 0 comments
SWHL commented
Thank you for your work.
I may find some little errors, as follows:
- Your code(module/corner_pooling.py):
def LeftPool(inputs):
#forward
def forward(inputs):
out=tf.expand_dims(tf.reduce_max(inputs,2),2)
i=tf.constant(1)
batch,h,w,c=inputs.get_shape().as_list()
def cond(i,out):
return i < w
def body(i,out):
d=tf.expand_dims(tf.reduce_max(inputs[:,:,i:,:],2),2)
out=tf.concat((out,d),2)
i = i + 1
return i,out
_,out = tf.while_loop(cond, body, [i,out],shape_invariants= [i.get_shape(), tf.TensorShape([batch,h,None,c])])
return out
- The source code(models/py_utils/_cptools/src/left_pool.cpp):
for (int64_t ind = 1; ind < width; ++ind) {
input_temp = input.select(3, width - ind - 1);
output_temp = output.select(3, width - ind);
max_temp = output.select(3, width - ind - 1);
at::max_out(max_temp, input_temp, output_temp);
}
The source code shows that the left_pool is from the right to left, but the code implementation of the LeftPool is from left to right.
I think these two implementation methods have different sense. Meanwhile, the other pools also have the same question.
Looking forward to your reply :)