class_docstr: Additive angular margin softmax.
  
  Paper: Deng, Jiankang, et al. "Arcface: Additive angular margin loss for
  deep face recognition." Proceedings of the IEEE/CVF conference on computer
  vision and pattern recognition. 2019.
  
  args:
      nout    : dimensionality of speaker embedding
      nclases: number of speakers in the training set
      margin  : margin value of AAMSoftmax
      scale   : scale value of AAMSoftmax
code: def forward(self, x, label=None):
      if len(label.size()) == 2:
          label = label.squeeze(1)
  
      assert x.size()[0] == label.size()[0]
      assert x.size()[1] == self.in_feats
  
      # cos(theta)
      cosine = F.linear(F.normalize(x), F.normalize(self.weight))
      # cos(theta + m)
      sine = torch.sqrt((1.0 - torch.mul(cosine, cosine)).clamp(0, 1))
      phi = cosine * self.cos_m - sine * self.sin_m
  
      if self.easy_margin:
          phi = torch.where(cosine > 0, phi, cosine)
      else:
          phi = torch.where(
              (cosine - self.th) > 0, phi, cosine - self.mm
          )
  
      one_hot = torch.zeros_like(cosine)
      one_hot.scatter_(1, label.view(-1, 1), 1)
      output = (one_hot * phi) + ((1.0 - one_hot) * cosine)
      output = output * self.s
  
      loss = self.ce(output, label)
      return loss
  
file_path: espnet/espnet2/spk/loss/aamsoftmax.py
imports: import math
  import torch
  import torch.nn
  import torch.nn.functional
  from espnet2.spk.loss.abs_loss import AbsLoss
label_desc: Use image node_id 2 for calling the AAMSoftmax obj's underlying member method code with example usage: obj.forward(x, label) and returns: loss