Closed TVayne closed 2 years ago
@tzp123456
generate_grid
outputs the unnormalized grid with [min, max] -> [0, image dimension], while generate_grid_unit
outputs the normalized grid that will fit the coordinate system used in affine_grid and grid_sample in Pytorch.
Technically, we don't need generate_grid
to train our model. generate_grid
is used for the computation of Jacobian determinant loss, in which the weight of it is set to zero by default. The Jacobian determinant loss is inherited from our previous work.
We train our model using generate_grid_unit
and it shows slight improvement compared to the method using generate_grid
. (And avoid a lot of unnecessary computation.)
hi @cwmok I am sorry to bother you again.Why should I use
def generate_grid(imgshape)
function during the train?.And I should use the functiongenerate_grid_unit
(like centralization?)during my test on the label image's transformation. What's the difference between them?Looking forward to your reply.