class_docstr: From DETR source: https://github.com/facebookresearch/detr
  (detr/models/detr.py)
class_docstr_tok: ["From","DETR","source",":","https",":","\/\/github.com\/facebookresearch\/detr","(","detr\/models\/detr.py",")"]
docstr: From DETR source: https://github.com/facebookresearch/detr
  (detr/models/segmentation.py)
docstr_tok: ["From","DETR","source",":","https",":","\/\/github.com\/facebookresearch\/detr","(","detr\/models\/segmentation.py",")"]
code: def sigmoid_focal_loss(
      inputs, targets, num_boxes, alpha: float = 0.25, gamma: float = 2
  ):
      """
      From DETR source: https://github.com/facebookresearch/detr
      (detr/models/segmentation.py)
      """
  
      prob = inputs.sigmoid()
      ce_loss = torch.nn.functional.binary_cross_entropy_with_logits(
          inputs, targets, reduction="none"
      )
      p_t = prob * targets + (1 - prob) * (1 - targets)
      loss = ce_loss * ((1 - p_t) ** gamma)
  
      if alpha >= 0:
          alpha_t = alpha * targets + (1 - alpha) * (1 - targets)
          loss = alpha_t * loss
  
      return loss.mean(1).sum() / num_boxes
  
imports: from typing import List, Optional, Tuple, Union
  import torch
label_desc: Use image node_id 3 for calling the SetCriterion obj's underlying member method code with example usage: obj.sigmoid_focal_loss(inputs, targets, num_boxes, alpha, gamma) and returns: unknown