JirongZhang / DeepHomography

Content-Aware Unsupervised Deep Homography Estimation
MIT License
340 stars 57 forks source link

Question about feature_loss_mat dimension #31

Open sp9103 opened 3 years ago

sp9103 commented 3 years ago

I have a question about the dimensions of the feature_loss_mat calculated within resnet.forward.

feature_loss_mat = triplet_loss(patch_2, pred_I2_CnnFeature, patch_1)

feature_loss = torch.sum(torch.mul(feature_loss_mat, mask_ap)) / sum_value

feature_loss_mat is calculated using TripletMarginLoss, and the dimensions of the input are (64, 1, H, W). (if batch size is 64) At this time, the calculated dimension of feature_loss_mat is (64, H, W).

And finally, to calculate the loss, it is multiplied by mask_ap, and the dimension of mask_ap is (64,1,H,W).

In my opinion, the dimensions of feature_loss_mat and mask_ap should be the same. Is the difference between the two dimensions intended?