class_docstr: This loss is an adaptation of MultipleNegativesRankingLoss. MultipleNegativesRankingLoss computes the following loss:
  For a given anchor and a list of candidates, find the positive candidate.
  
  In MultipleNegativesSymmetricRankingLoss, we add another loss term: Given the positive and a list of all anchors,
  find the correct (matching) anchor.
  
  For the example of question-answering: You have (question, answer)-pairs. MultipleNegativesRankingLoss just computes
  the loss to find the answer for a given question. MultipleNegativesSymmetricRankingLoss additionally computes the
  loss to find the question for a given answer.
  
  Note: If you pass triplets, the negative entry will be ignored. A anchor is just searched for the positive.
  
  Example::
  
      from sentence_transformers import SentenceTransformer, losses, InputExample
      from torch.utils.data import DataLoader
  
      model = SentenceTransformer('distilbert-base-uncased')
      train_examples = [InputExample(texts=['Anchor 1', 'Positive 1']),
          InputExample(texts=['Anchor 2', 'Positive 2'])]
      train_dataloader = DataLoader(train_examples, shuffle=True, batch_size=32)
      train_loss = losses.MultipleNegativesSymmetricRankingLoss(model=model)
docstr: :param model: SentenceTransformer model
  :param scale: Output of similarity function is multiplied by scale value
  :param similarity_fct: similarity function between sentence embeddings. By default, cos_sim. Can also be set to dot product (and then set scale to 1)
code: def __init__(
      self,
      model: SentenceTransformer,
      scale: float = 20.0,
      similarity_fct=util.cos_sim,
  ):
      """
      :param model: SentenceTransformer model
      :param scale: Output of similarity function is multiplied by scale value
      :param similarity_fct: similarity function between sentence embeddings. By default, cos_sim. Can also be set to dot product (and then set scale to 1)
      """
      super(MultipleNegativesSymmetricRankingLoss, self).__init__()
      self.model = model
      self.scale = scale
      self.similarity_fct = similarity_fct
      self.cross_entropy_loss = nn.CrossEntropyLoss()
  
file_path: sentence-transformers/sentence_transformers/losses/MultipleNegativesSymmetricRankingLoss.py
imports: import torch
  from torch import nn, Tensor
  from typing import Iterable, Dict
  from ..SentenceTransformer import SentenceTransformer
  from ..None import util
label_desc: Use image node_id 1 to create a new MultipleNegativesSymmetricRankingLoss object from inherited base classes: nn with example: obj = MultipleNegativesSymmetricRankingLoss(model, scale, similarity_fct)