code: def __init__(
      self,
      num_classes=80,
      hidden_dim=256,
      num_queries=900,
      position_embed_type="sine",
      return_intermediate_dec=True,
      backbone_feat_channels=[512, 1024, 2048],
      num_levels=4,
      num_encoder_points=4,
      num_decoder_points=4,
      nhead=8,
      num_encoder_layers=6,
      num_decoder_layers=6,
      dim_feedforward=1024,
      dropout=0.0,
      activation="relu",
      pe_temperature=10000,
      pe_offset=-0.5,
      num_denoising=100,
      label_noise_ratio=0.5,
      box_noise_scale=1.0,
      learnt_init_query=True,
      use_input_proj=True,
      dual_queries=False,
      dual_groups=0,
      eps=1e-2,
  ):
      super(GroupDINOTransformer, self).__init__()
      assert position_embed_type in [
          "sine",
          "learned",
      ], f"ValueError: position_embed_type not supported {position_embed_type}!"
      assert len(backbone_feat_channels) <= num_levels
  
      self.hidden_dim = hidden_dim
      self.nhead = nhead
      self.num_levels = num_levels
      self.num_classes = num_classes
      self.num_queries = num_queries
      self.eps = eps
      self.num_decoder_layers = num_decoder_layers
      self.use_input_proj = use_input_proj
  
      if use_input_proj:
          # backbone feature projection
          self._build_input_proj_layer(backbone_feat_channels)
  
      # Transformer module
      encoder_layer = DINOTransformerEncoderLayer(
          hidden_dim,
          nhead,
          dim_feedforward,
          dropout,
          activation,
          num_levels,
          num_encoder_points,
      )
      self.encoder = DINOTransformerEncoder(
          encoder_layer, num_encoder_layers
      )
      decoder_layer = DINOTransformerDecoderLayer(
          hidden_dim,
          nhead,
          dim_feedforward,
          dropout,
          activation,
          num_levels,
          num_decoder_points,
          dual_queries=dual_queries,
          dual_groups=dual_groups,
      )
      self.decoder = DINOTransformerDecoder(
          hidden_dim,
          decoder_layer,
          num_decoder_layers,
          return_intermediate_dec,
      )
  
      # denoising part
      self.denoising_class_embed = nn.Embedding(
          num_classes,
          hidden_dim,
          weight_attr=ParamAttr(initializer=nn.initializer.Normal()),
      )
      self.num_denoising = num_denoising
      self.label_noise_ratio = label_noise_ratio
      self.box_noise_scale = box_noise_scale
  
      # for dual group
      self.dual_queries = dual_queries
      self.dual_groups = dual_groups
      if self.dual_queries:
          self.denoising_class_embed_groups = nn.LayerList(
              [
                  nn.Embedding(
                      num_classes,
                      hidden_dim,
                      weight_attr=ParamAttr(
                          initializer=nn.initializer.Normal()
                      ),
                  )
                  for _ in range(self.dual_groups)
              ]
          )
  
      # position embedding
      self.position_embedding = PositionEmbedding(
          hidden_dim // 2,
          temperature=pe_temperature,
          normalize=True if position_embed_type == "sine" else False,
          embed_type=position_embed_type,
          offset=pe_offset,
      )
      self.level_embed = nn.Embedding(num_levels, hidden_dim)
      # decoder embedding
      self.learnt_init_query = learnt_init_query
      if learnt_init_query:
          self.tgt_embed = nn.Embedding(num_queries, hidden_dim)
          normal_(self.tgt_embed.weight)
          if self.dual_queries:
              self.tgt_embed_dual = nn.LayerList(
                  [
                      nn.Embedding(num_queries, hidden_dim)
                      for _ in range(self.dual_groups)
                  ]
              )
              for dual_tgt_module in self.tgt_embed_dual:
                  normal_(dual_tgt_module.weight)
      self.query_pos_head = MLP(
          2 * hidden_dim, hidden_dim, hidden_dim, num_layers=2
      )
  
      # encoder head
      self.enc_output = nn.Sequential(
          nn.Linear(hidden_dim, hidden_dim),
          nn.LayerNorm(
              hidden_dim,
              weight_attr=ParamAttr(regularizer=L2Decay(0.0)),
              bias_attr=ParamAttr(regularizer=L2Decay(0.0)),
          ),
      )
      if self.dual_queries:
          self.enc_output = _get_clones(
              self.enc_output, self.dual_groups + 1
          )
      else:
          self.enc_output = _get_clones(self.enc_output, 1)
  
      self.enc_score_head = nn.Linear(hidden_dim, num_classes)
      self.enc_bbox_head = MLP(hidden_dim, hidden_dim, 4, num_layers=3)
  
      if self.dual_queries:
          self.enc_bbox_head_dq = nn.LayerList(
              [
                  MLP(hidden_dim, hidden_dim, 4, num_layers=3)
                  for i in range(self.dual_groups)
              ]
          )
          self.enc_score_head_dq = nn.LayerList(
              [
                  nn.Linear(hidden_dim, num_classes)
                  for i in range(self.dual_groups)
              ]
          )
  
      # decoder head
      self.dec_score_head = nn.LayerList(
          [
              nn.Linear(hidden_dim, num_classes)
              for _ in range(num_decoder_layers)
          ]
      )
      self.dec_bbox_head = nn.LayerList(
          [
              MLP(hidden_dim, hidden_dim, 4, num_layers=3)
              for _ in range(num_decoder_layers)
          ]
      )
  
      self._reset_parameters()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle import ParamAttr
  from paddle.regularizer import L2Decay
  from ppdet.core.workspace import register
  from ..layers import MultiHeadAttention
  from .position_encoding import PositionEmbedding
  from ..heads.detr_head import MLP
  from .deformable_transformer import MSDeformableAttention
  from ..initializer import linear_init_, constant_, xavier_uniform_, normal_, bias_init_with_prob
  from .utils import _get_clones, get_valid_ratio, get_contrastive_denoising_training_group, get_sine_pos_embed, inverse_sigmoid
label_desc: Use image node_id 1 to create a new GroupDINOTransformer object from inherited base classes: nn with example: obj = GroupDINOTransformer(num_classes, hidden_dim, num_queries, position_embed_type, return_intermediate_dec, backbone_feat_channels, num_levels, num_encoder_points, num_decoder_points, nhead, num_encoder_layers, num_decoder_layers, dim_feedforward, dropout, activation, pe_temperature, pe_offset, num_denoising, label_noise_ratio, box_noise_scale, learnt_init_query, use_input_proj, dual_queries, dual_groups, eps)