def __init__(self, margin=0, max_violation=False):
    super(ContrastiveLoss, self).__init__()
    self.margin = margin
    self.max_violation = max_violation
def __init__(self, margin=0, max_violation=False):
    super(ContrastiveLoss, self).__init__()
    self.margin = margin
    self.max_violation = max_violation