背景
encoderとdecoderのネットワークでmax_poolしてからmax_unpoolしてるのを見て、これは一体なんの意味があるのか気になったので実験してみた実験
test codex_4, indices_4 = F.max_pool2d(x_42, kernel_size=2, stride=2, return_indices=True)
x_4d = F.max_unpool2d(x_4, indices_4, kernel_size=2, stride=2, output_size=dim_4)
print("x_4d.shape=",x_4d.shape)
print("x_42.shape=",x_42.shape)
save_image(x_4d[0,0,:,:],"x_4d.png")
save_image(x_42[0,0,:,:],"x_42.png")
output
x_4d.shape= (8, 512, 14, 14)
x_42.shape= (8, 512, 14, 14)