Sentence-similarity-classifier-for-pyTorch icon indicating copy to clipboard operation
Sentence-similarity-classifier-for-pyTorch copied to clipboard

Loss calculation is wrong

Open preesee opened this issue 7 years ago • 0 comments

I think the code has a little issue in loss calculation: when " # Obtain similarity score predictions by calculating the Manhattan distance between sentence encoding" self.prediction = torch.exp(-torch.norm((self.encoding_a - self.encoding_b), 1)) here the prediction is between [0,1) (e^-(a(hi)-b(hi))) , I think the code should not calculate the loss (prediction)with labeled data without data range alignment , do you think we should process prediction with : prediction*4+1? Cause data in dataset is all labeled with value [0,5]

preesee avatar Jul 08 '18 15:07 preesee