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 set_stats(self, ap_dist, an_dist, triplet_margin):
      if self.collect_stats:
          with torch.no_grad():
              self.pos_pair_dist = torch.mean(ap_dist).item()
              self.neg_pair_dist = torch.mean(an_dist).item()
              self.avg_triplet_margin = torch.mean(
                  triplet_margin
              ).item()
  
imports: import torch
  from ..utils import loss_and_miner_utils
  from .base_miner import BaseMiner
label_desc: Use image node_id 3 for calling the TripletMarginMiner obj's underlying member method code with example usage: obj.set_stats(ap_dist, an_dist, triplet_margin) without return types