code: def __init__(
      self,
      net,
      optimizer,
      rpn_cls_loss,
      rpn_box_loss,
      rcnn_cls_loss,
      rcnn_box_loss,
      mix_ratio,
  ):
      super(ForwardBackwardTask, self).__init__()
      self.net = net
      self._optimizer = optimizer
      self.rpn_cls_loss = rpn_cls_loss
      self.rpn_box_loss = rpn_box_loss
      self.rcnn_cls_loss = rcnn_cls_loss
      self.rcnn_box_loss = rcnn_box_loss
      self.mix_ratio = mix_ratio
  
imports: import argparse
  import os
  import logging
  import time
  import gluoncv
  import mxnet
  import numpy
  from data import *
  from gluoncv import data, utils
  from gluoncv.data.batchify import Append, FasterRCNNTrainBatchify, Tuple
  from gluoncv.data.transforms.presets.rcnn import FasterRCNNDefaultTrainTransform, FasterRCNNDefaultValTransform
  from gluoncv.model_zoo import get_model
  from gluoncv.utils.metrics.coco_detection import COCODetectionMetric
  from gluoncv.utils.metrics.rcnn import RCNNAccMetric, RCNNL1LossMetric, RPNAccMetric, RPNL1LossMetric
  from gluoncv.utils.metrics.voc_detection import VOC07MApMetric
  from gluoncv.utils.parallel import Parallel, Parallelizable
  from model import faster_rcnn_resnet101_v1d_custom, faster_rcnn_resnet50_v1b_custom
  from mxnet import autograd, gluon
  from mxnet.contrib import amp
label_desc: Use image node_id 1 to create a new ForwardBackwardTask object from inherited base classes: Parallelizable with example: obj = ForwardBackwardTask(net, optimizer, rpn_cls_loss, rpn_box_loss, rcnn_cls_loss, rcnn_box_loss, mix_ratio)