class_docstr: Head of the Grounding DINO: Marrying DINO with Grounded Pre-Training for
  Open-Set Object Detection.
  
  Args:
      contrastive_cfg (dict, optional): Contrastive config that contains
        keys like ``max_text_len``. Defaults to dict(max_text_len=256).
class_docstr_tok: ["Head","of","the","Grounding","DINO",":","Marrying","DINO","with","Grounded","Pre-Training","for","Open-Set","Object","Detection",".","Args",":","contrastive_cfg","(","dict",",","optional",")",":","Contrastive","config","that","contains","keys","like","``","max_text_len","``",".","Defaults","to","dict","(","max_text_len=256",")","."]
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."""
      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
  import math
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  import torch.nn
  from mmcv.cnn import Linear
  from mmengine.model import constant_init
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.models.losses import QualityFocalLoss
  from mmdet.registry import MODELS
  from mmdet.structures import SampleList
  from mmdet.structures.bbox import bbox_cxcywh_to_xyxy, bbox_xyxy_to_cxcywh
  from mmdet.utils import InstanceList, reduce_mean
  from ..layers import inverse_sigmoid
  from .atss_vlfusion_head import convert_grounding_to_cls_scores
  from .dino_head import DINOHead
label_desc: Use image node_id 3 for calling the GroundingDINOHead obj's underlying member method code with example usage: obj.init_weights() without return types