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 your implementation, I found that you first used K-nearest neighbors to select negative samples and then calculated the mean of the distances.
Maybe because the result is too small, so multiply by a parameter alpha?
The text was updated successfully, but these errors were encountered:
Hi, i have a question about the alpha which is a Hyperparameter
base = torch.mean(dist_mat[i]).data[0]
计算logit, base的作用是防止超过计算机浮点数
pos_logit = torch.sum(torch.exp(self.alpha*(base - pos_neig)))
neg_logit = torch.sum(torch.exp(self.alpha*(base - neg_neig)))
loss_ = -torch.log(pos_logit/(pos_logit + neg_logit))
In your implementation, I found that you first used K-nearest neighbors to select negative samples and then calculated the mean of the distances.
Maybe because the result is too small, so multiply by a parameter alpha?
The text was updated successfully, but these errors were encountered: