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
When learning the code of sentence-transformers, I noticed the usage of torch.abs() in calculating the difference of sentence vectors. The below code is from the forward function in SoftmaxLoss
if self.concatenation_sent_difference:
vectors_concat.append(torch.abs(rep_a - rep_b))
I am curious about the effect of torch.abs() so I compared a paraphrasing task with or without torch.abs().
Results show that using torch.abs() is much better than not using it.
My question:
Why using torch.abs() is better?
Please forgive my ignorance and thanks for any explanation!
The text was updated successfully, but these errors were encountered:
When learning the code of sentence-transformers, I noticed the usage of
torch.abs()
in calculating the difference of sentence vectors. The below code is from the forward function in SoftmaxLossI am curious about the effect of
torch.abs()
so I compared a paraphrasing task with or withouttorch.abs()
.Results show that using
torch.abs()
is much better than not using it.My question:
Why using
torch.abs()
is better?Please forgive my ignorance and thanks for any explanation!
The text was updated successfully, but these errors were encountered: