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 __init__(
      self,
      nout,
      nclasses,
      margin=0.3,
      scale=15,
      easy_margin=False,
      **kwargs,
  ):
      super().__init__(nout)
  
      self.test_normalize = True
  
      self.m = margin
      self.s = scale
      self.in_feats = nout
      self.weight = torch.nn.Parameter(
          torch.FloatTensor(nclasses, nout), requires_grad=True
      )
      self.ce = nn.CrossEntropyLoss()
      nn.init.xavier_normal_(self.weight, gain=1)
  
      self.easy_margin = easy_margin
      self.cos_m = math.cos(self.m)
      self.sin_m = math.sin(self.m)
  
      # make the function cos(theta+m) monotonic decreasing while theta in [0°,180°]
      self.th = math.cos(math.pi - self.m)
      self.mm = math.sin(math.pi - self.m) * self.m
  
      print(
          "Initialised AAMSoftmax margin %.3f scale %.3f"
          % (self.m, self.s)
      )
  
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 1 to create a new AAMSoftmax object from inherited base classes: AbsLoss with example: obj = AAMSoftmax(nout, nclasses, margin, scale, easy_margin)