Skip to content

Commit

Permalink
Fix a typo in a docstring in CosineSimilarityLoss.py (#2553)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryant1410 authored Mar 26, 2024
1 parent 1e35d8c commit 7373533
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sentence_transformers/losses/CosineSimilarityLoss.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class CosineSimilarityLoss(nn.Module):
def __init__(self, model: SentenceTransformer, loss_fct=nn.MSELoss(), cos_score_transformation=nn.Identity()):
"""
CosineSimilarityLoss expects that the InputExamples consists of two texts and a float label. It computes the
vectors ``u = model(sentence_A)`` and v = ``model(sentence_B)`` and measures the cosine-similarity between the two.
vectors ``u = model(sentence_A)`` and ``v = model(sentence_B)`` and measures the cosine-similarity between the two.
By default, it minimizes the following loss: ``||input_label - cos_score_transformation(cosine_sim(u,v))||_2``.
:param model: SentenceTransformer model
Expand Down

0 comments on commit 7373533

Please sign in to comment.