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_with_labels(
      self, embeddings, labels, indices_tuple, ref_emb, ref_labels
  ):
      anchor_idx, positive_idx, negative_idx = lmu.convert_to_triplets(
          indices_tuple, labels, ref_labels, t_per_anchor="all"
      )  # Use all instead of t_per_anchor=1 to be deterministic
      mat = self.distance(embeddings, ref_emb)
      d_pos, d_neg = (
          mat[anchor_idx, positive_idx],
          mat[anchor_idx, negative_idx],
      )
      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 4 for calling the DynamicSoftMarginLoss obj's underlying member method code with example usage: obj.compute_loss_with_labels(embeddings, labels, indices_tuple, ref_emb, ref_labels) and returns: unknown