Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about feature_loss_mat dimension #31

Open
sp9103 opened this issue Jan 22, 2021 · 0 comments
Open

Question about feature_loss_mat dimension #31

sp9103 opened this issue Jan 22, 2021 · 0 comments

Comments

@sp9103
Copy link

sp9103 commented Jan 22, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant