# implementations of surrogate loss
import torch 

def squared_loss(margin, t):
    return (margin - t)** 2

def squared_hinge_loss(margin, t):
    return torch.maximum(margin - t, torch.tensor(0.0)) ** 2

def logistic_loss(margin, t):
    return torch.log(1+torch.log(-margin*t))
