You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in this article , what is mean by positive sample pairs and negative sample pairs?
does it mean as follow: positve sample pair: (sent1, sent2,1)
negative sample pair: {sent1, sent3,0)
something like that
i am trying to understand the loss function :
def calc_loss(self, y_true, y_pred): """ 矩阵计算batch内的cos loss """ y_true = y_true[::2] norms = (y_pred ** 2).sum(axis=1, keepdims=True) ** 0.5 y_pred = y_pred / norms y_pred = torch.sum(y_pred[::2] * y_pred[1::2], dim=1) * 20 y_pred = y_pred[:, None] - y_pred[None, :] y_true = y_true[:, None] < y_true[None, :] y_true = y_true.float() y_pred = y_pred - (1 - y_true) * 1e12 y_pred = y_pred.view(-1) y_pred = torch.cat((torch.tensor([0]).float().to(self.device), y_pred), dim=0) return torch.logsumexp(y_pred, dim=0)
if possible can you share any link or documentation of paper for this. thanks
The text was updated successfully, but these errors were encountered: