code: def forward(self, input, target):
      logpt = F.log_softmax(input, dim=-1)
      logpt = torch.gather(logpt, -1, target.unsqueeze(-1))
      logpt = logpt.view(-1)
      pt = Variable(logpt.data.exp())
  
      if self._alphas is not None:
          at = self._alphas.gather(0, target)
          logpt = logpt * Variable(at)
  
      if self.normalized:
          sum_ = 1 / torch.sum((1 - pt) ** self._gamma)
      else:
          sum_ = 1
  
      loss = -1 * sum_ * (1 - pt) ** self._gamma * logpt
      return loss.sum()
  
imports: from typing import Any
  from collections import OrderedDict
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.autograd import Variable
  from torch_points3d.datasets.segmentation import IGNORE_LABEL
  from .metric_losses import *
label_desc: Use image node_id 2 for calling the FocalLoss obj's underlying member method code with example usage: obj.forward(input, target) and returns: loss