def __init__(self, embedding_size, num_classes, final_criterion, margin=0, momentum=0.95):
    super(AdaCos, self).__init__()
    self.final_criterion = final_criterion
    self.margin = margin
    self.momentum = momentum
    self.prev_s = 10
    self.running_B = 1000
    self.running_theta = (math.pi / 4)
    self.eps = 1e-07
    self.register_parameter('weight', torch.nn.Parameter(torch.zeros(num_classes, embedding_size)))
    nn.init.xavier_uniform_(self.weight)
    self.idx = 0
def __init__(self, embedding_size, num_classes, final_criterion, margin=0, momentum=0.95):
    super(AdaCos, self).__init__()
    self.final_criterion = final_criterion
    self.margin = margin
    self.momentum = momentum
    self.prev_s = 10
    self.running_B = 1000
    self.running_theta = (math.pi / 4)
    self.eps = 1e-07
    self.register_parameter('weight', torch.nn.Parameter(torch.zeros(num_classes, embedding_size)))
    nn.init.xavier_uniform_(self.weight)
    self.idx = 0