code: def __init__(self, margin=1.0, p=2.0, mining="batch_all"):
      super().__init__()
      self.margin = margin
      self.p = p
      self.mining = mining
  
      if mining == "batch_all":
          self.loss_fn = batch_all_triplet_loss
      if mining == "batch_hard":
          self.loss_fn = batch_hard_triplet_loss
  
file_path: vision/references/similarity/loss.py
imports: import torch
  import torch.nn
label_desc: Use image node_id 1 to create a new TripletMarginLoss object from inherited base classes: nn with example: obj = TripletMarginLoss(margin, p, mining)