class_docstr: Implement of large margin arc distance with intertopk and subcenter:
  Reference:
      MULTI-QUERY MULTI-HEAD ATTENTION POOLING AND INTER-TOPK PENALTY
      FOR SPEAKER VERIFICATION.
      https://arxiv.org/pdf/2110.05042.pdf
      Sub-center ArcFace: Boosting Face Recognition by
      Large-Scale Noisy Web Faces.
      https://ibug.doc.ic.ac.uk/media/uploads/documents/eccv_1445.pdf
  Args:
      in_features: size of each input sample
      out_features: size of each output sample
      scale: norm of input feature
      margin: margin
      cos(theta + margin)
      K: number of sub-centers
      k_top: number of hard samples
      mp: margin penalty of hard samples
      do_lm: whether do large margin finetune
code: def __init__(
      self,
      nout,
      nclasses,
      scale=32.0,
      margin=0.2,
      easy_margin=False,
      K=3,
      mp=0.06,
      k_top=5,
      do_lm=False,
  ):
      super().__init__(nout)
      self.in_features = nout
      self.out_features = nclasses
      self.scale = scale
      self.margin = margin
      self.do_lm = do_lm
  
      # intertopk + subcenter
      self.K = K
      if do_lm:  # if do LMF, remove hard sample penalty
          self.mp = 0.0
          self.k_top = 0
      else:
          self.mp = mp
          self.k_top = k_top
  
      # initial classifier
      self.weight = nn.Parameter(
          torch.FloatTensor(self.K * nclasses, nout)
      )
      nn.init.xavier_uniform_(self.weight)
  
      self.easy_margin = easy_margin
      self.cos_m = math.cos(margin)
      self.sin_m = math.sin(margin)
      self.th = math.cos(math.pi - margin)
      self.mm = math.sin(math.pi - margin) * margin
      self.mmm = 1.0 + math.cos(
          math.pi - margin
      )  # this can make the output more continuous
      ########
      self.m = self.margin
      ########
      self.cos_mp = math.cos(0.0)
      self.sin_mp = math.sin(0.0)
  
      self.ce = nn.CrossEntropyLoss()
  
file_path: espnet/espnet2/spk/loss/aamsoftmax_subcenter_intertopk.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 ArcMarginProduct_intertopk_subcenter object from inherited base classes: AbsLoss with example: obj = ArcMarginProduct_intertopk_subcenter(nout, nclasses, scale, margin, easy_margin, K, mp, k_top, do_lm)