code: def __init__(
      self,
      num_classes=80,
      hidden_dim=256,
      num_queries=900,
      position_embed_type="sine",
      in_feats_channel=[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",
      lr_mult=1.0,
      pe_temperature=10000,
      pe_offset=-0.5,
      num_denoising=100,
      label_noise_ratio=0.5,
      box_noise_scale=1.0,
      learnt_init_query=True,
      eps=1e-2,
  ):
      super(DINOTransformer, self).__init__()
      assert position_embed_type in [
          "sine",
          "learned",
      ], f"ValueError: position_embed_type not supported {position_embed_type}!"
      assert len(in_feats_channel) <= 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
  
      weight_attr = ParamAttr(regularizer=L2Decay(0.0))
      bias_attr = ParamAttr(regularizer=L2Decay(0.0))
      # backbone feature projection
      self._build_input_proj_layer(
          in_feats_channel, weight_attr, bias_attr
      )
  
      # Transformer module
      encoder_layer = DeformableTransformerEncoderLayer(
          hidden_dim,
          nhead,
          dim_feedforward,
          dropout,
          activation,
          num_levels,
          num_encoder_points,
          lr_mult,
          weight_attr,
          bias_attr,
      )
      self.encoder = DeformableTransformerEncoder(
          encoder_layer, num_encoder_layers
      )
      decoder_layer = DINOTransformerDecoderLayer(
          hidden_dim,
          nhead,
          dim_feedforward,
          dropout,
          activation,
          num_levels,
          num_decoder_points,
          lr_mult,
          weight_attr,
          bias_attr,
      )
      self.decoder = DINOTransformerDecoder(
          hidden_dim,
          decoder_layer,
          num_decoder_layers,
          weight_attr,
          bias_attr,
      )
  
      # 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
  
      # 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)
      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=weight_attr, bias_attr=bias_attr
          ),
      )
      self.enc_score_head = nn.Linear(hidden_dim, num_classes)
      self.enc_bbox_head = MLP(hidden_dim, hidden_dim, 4, num_layers=3)
      # 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, DeformableTransformerEncoderLayer, DeformableTransformerEncoder
  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 DINOTransformer object from inherited base classes: nn with example: obj = DINOTransformer(num_classes, hidden_dim, num_queries, position_embed_type, in_feats_channel, num_levels, num_encoder_points, num_decoder_points, nhead, num_encoder_layers, num_decoder_layers, dim_feedforward, dropout, activation, lr_mult, pe_temperature, pe_offset, num_denoising, label_noise_ratio, box_noise_scale, learnt_init_query, eps)