class_docstr: Returns triplets that violate the margin
  Args:
      margin
      type_of_triplets: options are "all", "hard", or "semihard".
              "all" means all triplets that violate the margin
              "hard" is a subset of "all", but the negative is closer to the anchor than the positive
              "semihard" is a subset of "all", but the negative is further from the anchor than the positive
          "easy" is all triplets that are not in "all"
code: def __init__(self, margin=0.2, type_of_triplets="all", **kwargs):
      super().__init__(**kwargs)
      self.margin = margin
      self.type_of_triplets = type_of_triplets
      self.add_to_recordable_attributes(
          list_of_names=["margin"], is_stat=False
      )
      self.add_to_recordable_attributes(
          list_of_names=[
              "avg_triplet_margin",
              "pos_pair_dist",
              "neg_pair_dist",
          ],
          is_stat=True,
      )
  
imports: import torch
  from ..utils import loss_and_miner_utils
  from .base_miner import BaseMiner
label_desc: Use image node_id 1 to create a new TripletMarginMiner object from inherited base classes: BaseMiner with example: obj = TripletMarginMiner(margin, type_of_triplets)