class_docstr: Loss function with dynamical margin parameter introduced in https://openaccess.thecvf.com/content_ICCV_2019/papers/Zhang_Learning_Local_Descriptors_With_a_CDF-Based_Dynamic_Soft_Margin_ICCV_2019_paper.pdf
  
  Args:
      min_val: minimum significative value for `d_pos - d_neg`
      num_bins: number of equally spaced bins for the partition of the interval [min_val, :math:`+\infty`]
      momentum: weight assigned to the histogram computed from the current batch
class_docstr_tok: ["Loss","function","with","dynamical","margin","parameter","introduced","in","https",":","\/\/openaccess.thecvf.com\/content_ICCV_2019\/papers\/Zhang_Learning_Local_Descriptors_With_a_CDF-Based_Dynamic_Soft_Margin_ICCV_2019_paper.pdf","Args",":","min_val",":","minimum","significative","value","for","`","d_pos","-","d_neg","`","num_bins",":","number","of","equally","spaced","bins","for","the","partition","of","the","interval","[","min_val",",",":","math",":","`","+\\infty","`","]","momentum",":","weight","assigned","to","the","histogram","computed","from","the","current","batch"]
code: def compute_loss_without_labels(
      self, embeddings, labels, indices_tuple, ref_emb, ref_labels
  ):
      mat = self.distance(embeddings, ref_emb)
      r, c = mat.size()
  
      d_pos = torch.zeros(max(r, c))
      d_pos = c_f.to_device(
          d_pos, tensor=embeddings, dtype=embeddings.dtype
      )
      d_pos[: min(r, c)] = mat.diag()
      mat.fill_diagonal_(np.inf)
  
      min_a, min_p = torch.zeros(max(r, c)), torch.zeros(
          max(r, c)
      )  # Check for unequal number of anchors and positives
      min_a = c_f.to_device(
          min_a, tensor=embeddings, dtype=embeddings.dtype
      )
      min_p = c_f.to_device(
          min_p, tensor=embeddings, dtype=embeddings.dtype
      )
      min_a[:c], _ = torch.min(mat, dim=0)
      min_p[:r], _ = torch.min(mat, dim=1)
  
      d_neg = torch.min(min_a, min_p)
      return d_pos - d_neg
  
file_path: pytorch-metric-learning/src/pytorch_metric_learning/losses/dynamic_soft_margin_loss.py
imports: import numpy
  import torch
  from ..distances import LpDistance
  from ..utils import common_functions
  from ..utils import loss_and_miner_utils
  from .base_metric_loss_function import BaseMetricLossFunction
label_desc: Use image node_id 3 for calling the DynamicSoftMarginLoss obj's underlying member method code with example usage: obj.compute_loss_without_labels(embeddings, labels, indices_tuple, ref_emb, ref_labels) and returns: unknown