class_docstr: Head of DeformDETR: Deformable DETR: Deformable Transformers for
  End-to-End Object Detection.
  
  Code is modified from the `official github repo
  <https://github.com/fundamentalvision/Deformable-DETR>`_.
  
  More details can be found in the `paper
  <https://arxiv.org/abs/2010.04159>`_ .
  
  Args:
      share_pred_layer (bool): Whether to share parameters for all the
          prediction layers. Defaults to `False`.
      num_pred_layer (int): The number of the prediction layers.
          Defaults to 6.
      as_two_stage (bool, optional): Whether to generate the proposal
          from the outputs of encoder. Defaults to `False`.
docstr: Initialize weights of the Deformable DETR head.
docstr_tok: ["Initialize","weights","of","the","Deformable","DETR","head","."]
code: def init_weights(self) -> None:
      """Initialize weights of the Deformable DETR head."""
      if self.loss_cls.use_sigmoid:
          bias_init = bias_init_with_prob(0.01)
          for m in self.cls_branches:
              if hasattr(m, "bias") and m.bias is not None:
                  nn.init.constant_(m.bias, bias_init)
      for m in self.reg_branches:
          constant_init(m[-1], 0, bias=0)
      nn.init.constant_(self.reg_branches[0][-1].bias.data[2:], -2.0)
      if self.as_two_stage:
          for m in self.reg_branches:
              nn.init.constant_(m[-1].bias.data[2:], 0.0)
  
imports: import copy
  from typing import Dict, List, Tuple
  import torch
  import torch.nn
  from mmcv.cnn import Linear
  from mmengine.model import bias_init_with_prob, constant_init
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures import SampleList
  from mmdet.utils import InstanceList, OptInstanceList
  from ..layers import inverse_sigmoid
  from .detr_head import DETRHead
label_desc: Use image node_id 3 for calling the DeformableDETRHead obj's underlying member method code with example usage: obj.init_weights() without return types