code: def __init__(
      self,
      num_queries=300,
      position_embed_type="sine",
      return_intermediate_dec=True,
      in_feats_channel=[512, 1024, 2048],
      num_feature_levels=4,
      num_encoder_points=4,
      num_decoder_points=4,
      hidden_dim=256,
      nhead=8,
      num_encoder_layers=6,
      num_decoder_layers=6,
      dim_feedforward=1024,
      dropout=0.1,
      activation="relu",
      lr_mult=0.1,
      pe_temperature=10000,
      pe_offset=-0.5,
  ):
      super(DeformableTransformer, 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_feature_levels
  
      self.hidden_dim = hidden_dim
      self.nhead = nhead
      self.num_feature_levels = num_feature_levels
  
      encoder_layer = DeformableTransformerEncoderLayer(
          hidden_dim,
          nhead,
          dim_feedforward,
          dropout,
          activation,
          num_feature_levels,
          num_encoder_points,
          lr_mult,
      )
      self.encoder = DeformableTransformerEncoder(
          encoder_layer, num_encoder_layers
      )
  
      decoder_layer = DeformableTransformerDecoderLayer(
          hidden_dim,
          nhead,
          dim_feedforward,
          dropout,
          activation,
          num_feature_levels,
          num_decoder_points,
      )
      self.decoder = DeformableTransformerDecoder(
          decoder_layer, num_decoder_layers, return_intermediate_dec
      )
  
      self.level_embed = nn.Embedding(num_feature_levels, hidden_dim)
      self.tgt_embed = nn.Embedding(num_queries, hidden_dim)
      self.query_pos_embed = nn.Embedding(num_queries, hidden_dim)
  
      self.reference_points = nn.Linear(
          hidden_dim,
          2,
          weight_attr=ParamAttr(learning_rate=lr_mult),
          bias_attr=ParamAttr(learning_rate=lr_mult),
      )
  
      self.input_proj = nn.LayerList()
      for in_channels in in_feats_channel:
          self.input_proj.append(
              nn.Sequential(
                  nn.Conv2D(in_channels, hidden_dim, kernel_size=1),
                  nn.GroupNorm(32, hidden_dim),
              )
          )
      in_channels = in_feats_channel[-1]
      for _ in range(num_feature_levels - len(in_feats_channel)):
          self.input_proj.append(
              nn.Sequential(
                  nn.Conv2D(
                      in_channels,
                      hidden_dim,
                      kernel_size=3,
                      stride=2,
                      padding=1,
                  ),
                  nn.GroupNorm(32, hidden_dim),
              )
          )
          in_channels = hidden_dim
  
      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,
          eps=1e-4,
      )
  
      self._reset_parameters()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle import ParamAttr
  from ppdet.core.workspace import register
  from ..layers import MultiHeadAttention
  from .position_encoding import PositionEmbedding
  from .utils import _get_clones, get_valid_ratio
  from ..initializer import linear_init_, constant_, xavier_uniform_, normal_
label_desc: Use image node_id 1 to create a new DeformableTransformer object from inherited base classes: nn with example: obj = DeformableTransformer(num_queries, position_embed_type, return_intermediate_dec, in_feats_channel, num_feature_levels, num_encoder_points, num_decoder_points, hidden_dim, nhead, num_encoder_layers, num_decoder_layers, dim_feedforward, dropout, activation, lr_mult, pe_temperature, pe_offset)