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.
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","."]
code: def __init__(
      self,
      use_sigmoid=True,
      beta=2.0,
      reduction="mean",
      loss_weight=1.0,
  ):
      super(QualityFocalLoss, self).__init__()
      self.use_sigmoid = use_sigmoid
      self.beta = beta
      assert reduction in ("none", "mean", "sum")
      self.reduction = reduction
      self.loss_weight = loss_weight
  
file_path: PaddleDetection/ppdet/modeling/losses/gfocal_loss.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register, serializable
  from ppdet.modeling import ops
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)