class_docstr: FCOSR Head, refer to https://arxiv.org/abs/2111.10780 for details 
class_docstr_tok: ["FCOSR","Head",",","refer","to","https",":","\/\/arxiv.org\/abs\/2111.10780","for","details"]
code: def forward_train(self, feats, target=None):
      (
          anchor_points,
          stride_tensor,
          num_anchors_list,
      ) = self._generate_anchors(feats)
      cls_pred_list, reg_pred_list = [], []
      for stride, feat, scale in zip(
          self.fpn_strides, feats, self.scales
      ):
          # cls
          cls_feat = feat
          for cls_layer in self.stem_cls:
              cls_feat = cls_layer(cls_feat)
          cls_pred = F.sigmoid(self.pred_cls(cls_feat))
          cls_pred_list.append(cls_pred.flatten(2).transpose((0, 2, 1)))
          # reg
          reg_feat = feat
          for reg_layer in self.stem_reg:
              reg_feat = reg_layer(reg_feat)
  
          reg_xy = scale(self.pred_xy(reg_feat)) * stride
          reg_wh = F.elu(scale(self.pred_wh(reg_feat)) + 1.0) * stride
          reg_angle = self.pred_angle(reg_feat)
          reg_angle = fmod(reg_angle, self.half_pi)
          reg_pred = paddle.concat([reg_xy, reg_wh, reg_angle], axis=1)
          reg_pred_list.append(reg_pred.flatten(2).transpose((0, 2, 1)))
  
      cls_pred_list = paddle.concat(cls_pred_list, axis=1)
      reg_pred_list = paddle.concat(reg_pred_list, axis=1)
  
      return self.get_loss(
          [
              cls_pred_list,
              reg_pred_list,
              anchor_points,
              stride_tensor,
              num_anchors_list,
          ],
          target,
      )
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register
  from paddle import ParamAttr
  from paddle.regularizer import L2Decay
  from .fcos_head import ScaleReg
  from ..initializer import bias_init_with_prob, constant_, normal_
  from ..ops import get_act_fn, anchor_generator
  from ..rbox_utils import box2corners
  from ..losses import ProbIoULoss
  import numpy
label_desc: Use image node_id 6 for calling the FCOSRHead obj's underlying member method code with example usage: obj.forward_train(feats, target) and returns: self