class_docstr: Binary loss for ASV Spoofing.
docstr: Forward.
  Args:
      label (torch.Tensor): ground truth label [Batch, 1]
      emb   (torch.Tensor): encoder embedding output [Batch, T, enc_dim]
docstr_tok: ["Forward",".","Args",":","label","(","torch.Tensor",")",":","ground","truth","label","[","Batch",",","1","]","emb","(","torch.Tensor",")",":","encoder","embedding","output","[","Batch",",","T",",","enc_dim","]"]
code: def forward(self, label: torch.Tensor, emb: torch.Tensor, **kwargs):
      """Forward.
      Args:
          label (torch.Tensor): ground truth label [Batch, 1]
          emb   (torch.Tensor): encoder embedding output [Batch, T, enc_dim]
      """
      batch_size = emb.shape[0]
      emb = torch.mean(emb, dim=1)
      norms = torch.norm(emb, p=2, dim=-1, keepdim=True)
      nfeat = torch.div(emb, norms)
  
      norms_c = torch.norm(self.centers, p=2, dim=-1, keepdim=True)
      ncenters = torch.div(self.centers, norms_c)
      logits = torch.matmul(nfeat, torch.transpose(ncenters, 0, 1))
  
      y_onehot = torch.FloatTensor(batch_size, 2)
      y_onehot.zero_()
      y_onehot = torch.autograd.Variable(y_onehot)
      y_onehot.scatter_(1, torch.unsqueeze(label, dim=-1), self.m)
      margin_logits = self.s * (logits - y_onehot)
      loss = self.loss(
          self.sigmoid(margin_logits[:, 0]), label.view(-1).float()
      )
  
      return loss
  
imports: import torch
  from espnet2.asvspoof.loss.abs_loss import AbsASVSpoofLoss
  from espnet.nets.pytorch_backend.nets_utils import to_device
label_desc: Use image node_id 2 for calling the ASVSpoofAMSoftmaxLoss obj's underlying member method code with example usage: obj.forward(label, emb) and returns: loss