sigmoid_focal_loss

dragon.vm.torch.nn.functional.sigmoid_focal_loss(
  input,
  target,
  alpha=0.25,
  gamma=2.0,
  weight=None,
  size_average=None,
  start_index=0,
  reduce=None,
  reduction='mean'
)[source]

Compute the sigmoid focal loss. [Lin et.al, 2017].

Parameters:
  • input (dragon.vm.torch.Tensor) The input tensor.
  • target (dragon.vm.torch.Tensor) The target tensor.
  • alpha (float, optional, default=0.25) The scale factor on the rare class.
  • gamma (float, optional, default=2.) The exponential decay factor on the easy examples.
  • weight (dragon.vm.torch.Tensor, optional) The weight for each class.
  • size_average (bool, optional) Whether to average the loss.
  • start_index (int, optional, default=0) The start value of index.
  • reduce (bool, optional) Whether to reduce the loss.
  • reduction ({'none', 'mean', 'sum', 'valid'}, optional) The reduce method.
Returns:

dragon.vm.torch.Tensor The output tensor.