LeapLabTHU/DAT

displacement problem

ZhuangLii opened this issue · 1 comments

hello sir,
why the displacement is calculated as below ?
displacement = (q_grid.reshape(B * self.n_groups, H * W, 2).unsqueeze(2) - pos.reshape(B * self.n_groups, n_sample, 2).unsqueeze(1)).mul(0.5)
why not
displacement = (pos.reshape(B * self.n_groups, H * W, 2).unsqueeze(2) - pos.reshape(B * self.n_groups, n_sample, 2).unsqueeze(1))

The subtraction of two numbers in [-1, 1] lies in [-2, 2], while the grid_sample operation needs the coordinates to be in [-1, 1].