class_docstr: Focal and Global Knowledge Distillation for Detectors
  The code is reference from https://github.com/yzd-v/FGD/blob/master/mmdet/distillation/losses/fgd.py
  
  Args:
      student_channels (int): The number of channels in the student's FPN feature map. Default to 256.
      teacher_channels (int): The number of channels in the teacher's FPN feature map. Default to 256.
      normalize (bool): Whether to normalize the feature maps.
      temp (float, optional): The temperature coefficient. Defaults to 0.5.
      alpha_fgd (float, optional): The weight of fg_loss. Defaults to 0.001
      beta_fgd (float, optional): The weight of bg_loss. Defaults to 0.0005
      gamma_fgd (float, optional): The weight of mask_loss. Defaults to 0.001
      lambda_fgd (float, optional): The weight of relation_loss. Defaults to 0.000005
class_docstr_tok: ["Focal","and","Global","Knowledge","Distillation","for","Detectors","The","code","is","reference","from","https",":","\/\/github.com\/yzd-v\/FGD\/blob\/master\/mmdet\/distillation\/losses\/fgd.py","Args",":","student_channels","(","int",")",":","The","number","of","channels","in","the","student","'s","FPN","feature","map",".","Default","to","256.","teacher_channels","(","int",")",":","The","number","of","channels","in","the","teacher","'s","FPN","feature","map",".","Default","to","256.","normalize","(","bool",")",":","Whether","to","normalize","the","feature","maps",".","temp","(","float",",","optional",")",":","The","temperature","coefficient",".","Defaults","to","0.5.","alpha_fgd","(","float",",","optional",")",":","The","weight","of","fg_loss",".","Defaults","to","0.001","beta_fgd","(","float",",","optional",")",":","The","weight","of","bg_loss",".","Defaults","to","0.0005","gamma_fgd","(","float",",","optional",")",":","The","weight","of","mask_loss",".","Defaults","to","0.001","lambda_fgd","(","float",",","optional",")",":","The","weight","of","relation_loss",".","Defaults","to","0.000005"]
code: def feature_loss(
      self,
      stu_feature,
      tea_feature,
      mask_fg,
      mask_bg,
      tea_channel_att,
      tea_spatial_att,
  ):
      mask_fg = mask_fg.unsqueeze(axis=1)
      mask_bg = mask_bg.unsqueeze(axis=1)
      tea_channel_att = tea_channel_att.unsqueeze(axis=-1).unsqueeze(
          axis=-1
      )
      tea_spatial_att = tea_spatial_att.unsqueeze(axis=1)
  
      fea_t = paddle.multiply(tea_feature, paddle.sqrt(tea_spatial_att))
      fea_t = paddle.multiply(fea_t, paddle.sqrt(tea_channel_att))
      fg_fea_t = paddle.multiply(fea_t, paddle.sqrt(mask_fg))
      bg_fea_t = paddle.multiply(fea_t, paddle.sqrt(mask_bg))
  
      fea_s = paddle.multiply(stu_feature, paddle.sqrt(tea_spatial_att))
      fea_s = paddle.multiply(fea_s, paddle.sqrt(tea_channel_att))
      fg_fea_s = paddle.multiply(fea_s, paddle.sqrt(mask_fg))
      bg_fea_s = paddle.multiply(fea_s, paddle.sqrt(mask_bg))
  
      fg_loss = F.mse_loss(fg_fea_s, fg_fea_t, reduction="sum") / len(
          mask_fg
      )
      bg_loss = F.mse_loss(bg_fea_s, bg_fea_t, reduction="sum") / len(
          mask_bg
      )
      return fg_loss, bg_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 5 for calling the FGDFeatureLoss obj's underlying member method code with example usage: obj.feature_loss(stu_feature, tea_feature, mask_fg, mask_bg, tea_channel_att, tea_spatial_att) and returns: fg_loss,  bg_loss