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

"Doubleline" version - add another half of the loss and using getBatchHLoss() #47

Open
IlariaAnita opened this issue Apr 19, 2023 · 1 comment

Comments

@IlariaAnita
Copy link

Hi, I didn't figure out how to add another half of the loss.
Do I have to use getBatchHLoss() in the resnet file as I wrote in the following lines?

286 feature_loss_mat = triplet_loss(patch_2, pred_I2_CnnFeature, patch_1)
287
288 feature_loss = torch.sum(torch.mul(feature_loss_mat, mask_ap)) / sum_value
289 feature_loss = torch.unsqueeze(feature_loss, 0)
290
291 feature_loss_add_half = getBatchHLoss(H_mat, torch.linalg.inv(H_mat))
292 feature_loss_add_half = torch.unsqueeze(feature_loss_add_half, 0)
293
294 feature_loss = feature_loss.add(feature_loss_add_half)

@CallMeFrozenBanana
Copy link

Hi~ I assume the H is used for warping B to A. If you want to add the inverse feature loss you need to calculate the inverse H( warp A to B) and compute the triplet_loss again

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

2 participants