class_docstr: Implementation of `DAB-DETR:
  Dynamic Anchor Boxes are Better Queries for DETR.
  
  <https://arxiv.org/abs/2201.12329>`_.
  
  Code is modified from the `official github repo
  <https://github.com/IDEA-Research/DAB-DETR>`_.
  
  Args:
      with_random_refpoints (bool): Whether to randomly initialize query
          embeddings and not update them during training.
          Defaults to False.
      num_patterns (int): Inspired by Anchor-DETR. Defaults to 0.
class_docstr_tok: ["Implementation","of","`","DAB-DETR",":","Dynamic","Anchor","Boxes","are","Better","Queries","for","DETR",".","<","https",":","\/\/arxiv.org\/abs\/2201.12329",">","`","_",".","Code","is","modified","from","the","`","official","github","repo","<","https",":","\/\/github.com\/IDEA-Research\/DAB-DETR",">","`","_",".","Args",":","with_random_refpoints","(","bool",")",":","Whether","to","randomly","initialize","query","embeddings","and","not","update","them","during","training",".","Defaults","to","False",".","num_patterns","(","int",")",":","Inspired","by","Anchor-DETR",".","Defaults","to","0","."]
docstr: Initialize weights for Transformer and other components.
docstr_tok: ["Initialize","weights","for","Transformer","and","other","components","."]
code: def init_weights(self) -> None:
      """Initialize weights for Transformer and other components."""
      super(DABDETR, self).init_weights()
      if self.with_random_refpoints:
          uniform_init(self.query_embedding)
          self.query_embedding.weight.data[:, :2] = inverse_sigmoid(
              self.query_embedding.weight.data[:, :2]
          )
          self.query_embedding.weight.data[:, :2].requires_grad = False
  
file_path: mmdetection/mmdet/models/detectors/dab_detr.py
imports: from typing import Dict, Tuple
  from mmengine.model import uniform_init
  from torch import Tensor, nn
  from mmdet.registry import MODELS
  from ..layers import SinePositionalEncoding
  from ..layers.transformer import DABDetrTransformerDecoder, DABDetrTransformerEncoder, inverse_sigmoid
  from .detr import DETR
label_desc: Use image node_id 3 for calling the DABDETR obj's underlying member method code with example usage: obj.init_weights() without return types