docstr: is_binary: true if learning binary descriptor
  momentum: weight assigned to the histogram computed from the current batch
  max_dist: maximum possible distance in the feature space
  nbins: number of bins to discretize the PDF
docstr_tok: ["is_binary",":","true","if","learning","binary","descriptor","momentum",":","weight","assigned","to","the","histogram","computed","from","the","current","batch","max_dist",":","maximum","possible","distance","in","the","feature","space","nbins",":","number","of","bins","to","discretize","the","PDF"]
code: def __init__(
      self, is_binary=False, momentum=0.01, max_dist=None, nbins=512
  ):
      """
      is_binary: true if learning binary descriptor
      momentum: weight assigned to the histogram computed from the current batch
      max_dist: maximum possible distance in the feature space
      nbins: number of bins to discretize the PDF
      """
      super(
          OriginalImplementationDynamicSoftMarginLoss, self
      ).__init__()
      self._is_binary = is_binary
  
      if max_dist is None:
          # max_dist = 256 if self._is_binary else 2.0
          max_dist = 2.0
  
      self._momentum = momentum
      self._max_val = max_dist
      self._min_val = -max_dist
      self.register_buffer("histogram", torch.ones(nbins))
  
      self._stats_initialized = False
      self.current_step = None
  
imports: import torch
  import torch.nn
  from pytorch_metric_learning.utils import common_functions
  from pytorch_metric_learning.utils import loss_and_miner_utils
  import unittest
  from pytorch_metric_learning.losses import DynamicSoftMarginLoss
  from ..None import TEST_DEVICE, TEST_DTYPES
  from ..zzz_testing_utils.testing_utils import angle_to_coord
label_desc: Use image node_id 1 to create a new OriginalImplementationDynamicSoftMarginLoss object from inherited base classes: nn with example: obj = OriginalImplementationDynamicSoftMarginLoss(is_binary, momentum, max_dist, nbins)