class_docstr: Quality Focal Loss (QFL) is a variant of `Generalized Focal Loss:
  Learning Qualified and Distributed Bounding Boxes for Dense Object
  Detection <https://arxiv.org/abs/2006.04388>`_.
  
  Args:
      use_sigmoid (bool): Whether sigmoid operation is conducted in QFL.
          Defaults to True.
      beta (float): The beta parameter for calculating the modulating factor.
          Defaults to 2.0.
      reduction (str): Options are "none", "mean" and "sum".
      loss_weight (float): Loss weight of current loss.
      activated (bool, optional): Whether the input is activated.
          If True, it means the input has been activated and can be
          treated as probabilities. Else, it should be treated as logits.
          Defaults to False.
class_docstr_tok: ["Quality","Focal","Loss","(","QFL",")","is","a","variant","of","`","Generalized","Focal","Loss",":","Learning","Qualified","and","Distributed","Bounding","Boxes","for","Dense","Object","Detection","<","https",":","\/\/arxiv.org\/abs\/2006.04388",">","`","_",".","Args",":","use_sigmoid","(","bool",")",":","Whether","sigmoid","operation","is","conducted","in","QFL",".","Defaults","to","True",".","beta","(","float",")",":","The","beta","parameter","for","calculating","the","modulating","factor",".","Defaults","to","2.0.","reduction","(","str",")",":","Options","are","``","none","''",",","``","mean","''","and","``","sum","''",".","loss_weight","(","float",")",":","Loss","weight","of","current","loss",".","activated","(","bool",",","optional",")",":","Whether","the","input","is","activated",".","If","True",",","it","means","the","input","has","been","activated","and","can","be","treated","as","probabilities",".","Else",",","it","should","be","treated","as","logits",".","Defaults","to","False","."]
code: def __init__(
      self,
      use_sigmoid=True,
      beta=2.0,
      reduction="mean",
      loss_weight=1.0,
      activated=False,
  ):
      super(QualityFocalLoss, self).__init__()
      assert use_sigmoid is True, "Only sigmoid in QFL supported now."
      self.use_sigmoid = use_sigmoid
      self.beta = beta
      self.reduction = reduction
      self.loss_weight = loss_weight
      self.activated = activated
  
file_path: mmdetection/mmdet/models/losses/gfocal_loss.py
imports: from functools import partial
  import torch
  import torch.nn
  import torch.nn.functional
  from mmdet.models.losses.utils import weighted_loss
  from mmdet.registry import MODELS
label_desc: Use image node_id 1 to create a new QualityFocalLoss object from inherited base classes: nn with example: obj = QualityFocalLoss(use_sigmoid, beta, reduction, loss_weight, activated)