code: def quality_focal_loss(
      self,
      pred_logits,
      soft_target_logits,
      beta=2.0,
      use_sigmoid=False,
      num_total_pos=None,
  ):
      if use_sigmoid:
          func = F.binary_cross_entropy_with_logits
          soft_target = F.sigmoid(soft_target_logits)
          pred_sigmoid = F.sigmoid(pred_logits)
          preds = pred_logits
      else:
          func = F.binary_cross_entropy
          soft_target = soft_target_logits
          pred_sigmoid = pred_logits
          preds = pred_sigmoid
  
      scale_factor = pred_sigmoid - soft_target
      loss = func(
          preds, soft_target, reduction="none"
      ) * scale_factor.abs().pow(beta)
      loss = loss.sum(1)
  
      if num_total_pos is not None:
          loss = loss.sum() / num_total_pos
      else:
          loss = loss.mean()
      return loss
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle import ParamAttr
  from ppdet.core.workspace import register
  from ppdet.modeling import ops
  from ppdet.modeling.losses.iou_loss import GIoULoss
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 2 for calling the DistillPPYOLOELoss obj's underlying member method code with example usage: obj.quality_focal_loss(pred_logits, soft_target_logits, beta, use_sigmoid, num_total_pos) and returns: loss