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 spatial_channel_attention(self, x, t=0.5):
      shape = paddle.shape(x)
      N, C, H, W = shape
      _f = paddle.abs(x)
      spatial_map = paddle.reshape(
          paddle.mean(_f, axis=1, keepdim=True) / t, [N, -1]
      )
      spatial_map = (
          F.softmax(spatial_map, axis=1, dtype="float32") * H * W
      )
      spatial_att = paddle.reshape(spatial_map, [N, H, W])
  
      channel_map = paddle.mean(
          paddle.mean(_f, axis=2, keepdim=False), axis=2, keepdim=False
      )
      channel_att = (
          F.softmax(channel_map / t, axis=1, dtype="float32") * C
      )
      return [spatial_att, channel_att]
  
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 FGDFeatureLoss obj's underlying member method code with example usage: obj.spatial_channel_attention(x, t) and returns: list