class_docstr: Base class for semi-supervised detectors.
  
  Semi-supervised detectors typically consisting of a teacher model
  updated by exponential moving average and a student model updated
  by gradient descent.
  
  Args:
      detector (:obj:`ConfigDict` or dict): The detector config.
      semi_train_cfg (:obj:`ConfigDict` or dict, optional):
          The semi-supervised training config.
      semi_test_cfg (:obj:`ConfigDict` or dict, optional):
          The semi-supervised testing config.
      data_preprocessor (:obj:`ConfigDict` or dict, optional): Config of
          :class:`DetDataPreprocessor` to process the input data.
          Defaults to None.
      init_cfg (:obj:`ConfigDict` or list[:obj:`ConfigDict`] or dict or
          list[dict], optional): Initialization config dict.
          Defaults to None.
docstr: Calculate losses from multi-branch inputs and data samples.
  
  Args:
      multi_batch_inputs (Dict[str, Tensor]): The dict of multi-branch
          input images, each value with shape (N, C, H, W).
          Each value should usually be mean centered and std scaled.
      multi_batch_data_samples (Dict[str, List[:obj:`DetDataSample`]]):
          The dict of multi-branch data samples.
  
  Returns:
      dict: A dictionary of loss components
docstr_tok: ["Calculate","losses","from","multi-branch","inputs","and","data","samples",".","Args",":","multi_batch_inputs","(","Dict","[","str",",","Tensor","]",")",":","The","dict","of","multi-branch","input","images",",","each","value","with","shape","(","N",",","C",",","H",",","W",")",".","Each","value","should","usually","be","mean","centered","and","std","scaled",".","multi_batch_data_samples","(","Dict","[","str",",","List","[",":","obj",":","`","DetDataSample","`","]","]",")",":","The","dict","of","multi-branch","data","samples",".","Returns",":","dict",":","A","dictionary","of","loss","components"]
code: def loss(
      self,
      multi_batch_inputs: Dict[str, Tensor],
      multi_batch_data_samples: Dict[str, SampleList],
  ) -> dict:
      """Calculate losses from multi-branch inputs and data samples.
  
      Args:
          multi_batch_inputs (Dict[str, Tensor]): The dict of multi-branch
              input images, each value with shape (N, C, H, W).
              Each value should usually be mean centered and std scaled.
          multi_batch_data_samples (Dict[str, List[:obj:`DetDataSample`]]):
              The dict of multi-branch data samples.
  
      Returns:
          dict: A dictionary of loss components
      """
      losses = dict()
      losses.update(
          **self.loss_by_gt_instances(
              multi_batch_inputs["sup"], multi_batch_data_samples["sup"]
          )
      )
  
      (
          origin_pseudo_data_samples,
          batch_info,
      ) = self.get_pseudo_instances(
          multi_batch_inputs["unsup_teacher"],
          multi_batch_data_samples["unsup_teacher"],
      )
      multi_batch_data_samples[
          "unsup_student"
      ] = self.project_pseudo_instances(
          origin_pseudo_data_samples,
          multi_batch_data_samples["unsup_student"],
      )
      losses.update(
          **self.loss_by_pseudo_instances(
              multi_batch_inputs["unsup_student"],
              multi_batch_data_samples["unsup_student"],
              batch_info,
          )
      )
      return losses
  
imports: import copy
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  import torch.nn
  from torch import Tensor
  from mmdet.models.utils import filter_gt_instances, rename_loss_dict, reweight_loss_dict
  from mmdet.registry import MODELS
  from mmdet.structures import SampleList
  from mmdet.structures.bbox import bbox_project
  from mmdet.utils import ConfigType, OptConfigType, OptMultiConfig
  from .base import BaseDetector
label_desc: Use image node_id 3 for calling the SemiBaseDetector obj's underlying member method code with example usage: obj.loss(multi_batch_inputs, multi_batch_data_samples) and returns: losses