class_docstr: This class defines distance functions, that can be used with Batch[All/Hard/SemiHard]TripletLoss
docstr: Compute the 2D matrix of cosine distances (1-cosine_similarity) between all embeddings.
docstr_tok: ["Compute","the","2D","matrix","of","cosine","distances","(","1-cosine_similarity",")","between","all","embeddings","."]
code: def cosine_distance(embeddings):
      """
      Compute the 2D matrix of cosine distances (1-cosine_similarity) between all embeddings.
      """
      return 1 - util.pytorch_cos_sim(embeddings, embeddings)
  
file_path: sentence-transformers/sentence_transformers/losses/BatchHardTripletLoss.py
imports: import torch
  from torch import nn, Tensor
  from typing import Iterable, Dict
  from sentence_transformers import util
  from sentence_transformers.SentenceTransformer import SentenceTransformer
label_desc: Use image node_id 1 for calling the BatchHardTripletLossDistanceFunction obj's underlying member method code with example usage: obj.cosine_distance(embeddings) and returns: unknown