class_docstr: Compute contrastive loss
  Args:
      margin (int): margin
      measure (bool): measure
      max_violation (int): image feature dimension
class_docstr_tok: ["Compute","contrastive","loss","Args",":","margin","(","int",")",":","margin","measure","(","bool",")",":","measure","max_violation","(","int",")",":","image","feature","dimension"]
code: def __init__(self, margin=0, measure=False, max_violation=False):
      super().__init__()
      self.margin = margin
      if measure == "order":
          # self.sim = order_sim
          raise NotImplementedError
      elif measure == "cosine":
          # self.sim = cosine_sim
          raise NotImplementedError
      elif measure == "dot":
          self.sim = dot_sim
  
      self.max_violation = max_violation
  
file_path: towhee/towhee/models/mcprop/loss.py
imports: import torch
  from torch import nn
label_desc: Use image node_id 1 to create a new Contrastive object from inherited base classes: nn with example: obj = Contrastive(margin, measure, max_violation)