I'm confused about your spatial_pyramid_pool function, in this function I can't understand why pad?
I think [n,c,w,h] - > [n,c,a,a] (a is the number in Variable 'output_num' ) - > [n,-1] ,then feed this to fc. I think the right code is
h_wid = math.ceil(previous_conv_size[0]/out_pool_size[i])
w_wid = math.ceil(previous_conv_size[1]/out_pool_size[i])
h_str = math.floor(previous_conv_size[0]/out_pool_size[i])
w_str = math.floor(previous_conv_size[1]/out_pool_size[i])
maxpool = nn.MaxPool2d((h_wid, w_wid), stride=(h_str, w_str))
I'm confused about your spatial_pyramid_pool function, in this function I can't understand why pad? I think [n,c,w,h] - > [n,c,a,a] (a is the number in Variable 'output_num' ) - > [n,-1] ,then feed this to fc. I think the right code is h_wid = math.ceil(previous_conv_size[0]/out_pool_size[i]) w_wid = math.ceil(previous_conv_size[1]/out_pool_size[i]) h_str = math.floor(previous_conv_size[0]/out_pool_size[i]) w_str = math.floor(previous_conv_size[1]/out_pool_size[i]) maxpool = nn.MaxPool2d((h_wid, w_wid), stride=(h_str, w_str))