bo-zhang-cs / CGS-Pytorch

Unofficial PyTorch implementation of "Composing Good Shots by Exploiting Mutual Relations"
MIT License
13 stars 2 forks source link

had tried margin param in ranking loss? #1

Open dongdk opened 4 days ago

bo-zhang-cs commented 3 days ago
image

In my understanding, the term (g_i - g_j) in the above equation can be regarded as the margin of the ranking loss, so the author did not add an additional margin.

dongdk commented 3 days ago

yes i get it, thanks. btw, i want to try below to see whether it can work

    sign = torch.sign(gt_diff)
    indicat  = -1 * sign * (pre_diff - gt_diff * margin) ### margin >= 1.0, e.g. 1.1