class_docstr: Implementation of `LAD <https://arxiv.org/pdf/2108.10520.pdf>`_.
code: def __init__(
      self,
      backbone: ConfigType,
      neck: ConfigType,
      bbox_head: ConfigType,
      teacher_backbone: ConfigType,
      teacher_neck: ConfigType,
      teacher_bbox_head: ConfigType,
      teacher_ckpt: Optional[str] = None,
      eval_teacher: bool = True,
      train_cfg: OptConfigType = None,
      test_cfg: OptConfigType = None,
      data_preprocessor: OptConfigType = None,
  ) -> None:
      super(KnowledgeDistillationSingleStageDetector, self).__init__(
          backbone=backbone,
          neck=neck,
          bbox_head=bbox_head,
          train_cfg=train_cfg,
          test_cfg=test_cfg,
          data_preprocessor=data_preprocessor,
      )
      self.eval_teacher = eval_teacher
      self.teacher_model = nn.Module()
      self.teacher_model.backbone = MODELS.build(teacher_backbone)
      if teacher_neck is not None:
          self.teacher_model.neck = MODELS.build(teacher_neck)
      teacher_bbox_head.update(train_cfg=train_cfg)
      teacher_bbox_head.update(test_cfg=test_cfg)
      self.teacher_model.bbox_head = MODELS.build(teacher_bbox_head)
      if teacher_ckpt is not None:
          load_checkpoint(
              self.teacher_model, teacher_ckpt, map_location="cpu"
          )
  
file_path: mmdetection/mmdet/models/detectors/lad.py
imports: from typing import Optional
  import torch
  import torch.nn
  from mmengine.runner import load_checkpoint
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures import SampleList
  from mmdet.utils import ConfigType, OptConfigType
  from ..utils.misc import unpack_gt_instances
  from .kd_one_stage import KnowledgeDistillationSingleStageDetector
label_desc: Use image node_id 1 to create a new LAD object from inherited base classes: KnowledgeDistillationSingleStageDetector with example: obj = LAD(backbone, neck, bbox_head, teacher_backbone, teacher_neck, teacher_bbox_head, teacher_ckpt, eval_teacher, train_cfg, test_cfg, data_preprocessor)