code: def __init__(
      self,
      num_classes=1,
      edge_dim=3,
      num_atoms=4608,
      max_degree=512,
      num_spatial=511,
      multi_hop_max_dist=5,
      num_encoder_layers=12,
      embedding_dim=768,
      ffn_embedding_dim=768,
      num_attention_heads=32,
      dropout=0.1,
      pre_layernorm=True,
      activation_fn=nn.GELU(),
  ):
      super().__init__()
      self.dropout = nn.Dropout(p=dropout)
      self.embedding_dim = embedding_dim
      self.num_heads = num_attention_heads
  
      self.atom_encoder = nn.Embedding(
          num_atoms + 1, embedding_dim, padding_idx=0
      )
      self.graph_token = nn.Embedding(1, embedding_dim)
  
      self.degree_encoder = DegreeEncoder(
          max_degree=max_degree, embedding_dim=embedding_dim
      )
  
      self.path_encoder = PathEncoder(
          max_len=multi_hop_max_dist,
          feat_dim=edge_dim,
          num_heads=num_attention_heads,
      )
  
      self.spatial_encoder = SpatialEncoder(
          max_dist=num_spatial, num_heads=num_attention_heads
      )
      self.graph_token_virtual_distance = nn.Embedding(
          1, num_attention_heads
      )
  
      self.emb_layer_norm = nn.LayerNorm(self.embedding_dim)
  
      self.layers = nn.ModuleList([])
      self.layers.extend(
          [
              GraphormerLayer(
                  feat_size=self.embedding_dim,
                  hidden_size=ffn_embedding_dim,
                  num_heads=num_attention_heads,
                  dropout=dropout,
                  activation=activation_fn,
                  norm_first=pre_layernorm,
              )
              for _ in range(num_encoder_layers)
          ]
      )
  
      # map graph_rep to num_classes
      self.lm_head_transform_weight = nn.Linear(
          self.embedding_dim, self.embedding_dim
      )
      self.layer_norm = nn.LayerNorm(self.embedding_dim)
      self.activation_fn = activation_fn
      self.embed_out = nn.Linear(
          self.embedding_dim, num_classes, bias=False
      )
      self.lm_output_learned_bias = nn.Parameter(th.zeros(num_classes))
  
file_path: dgl/examples/core/Graphormer/model.py
imports: import torch
  import torch.nn
  from dgl.nn import DegreeEncoder, GraphormerLayer, PathEncoder, SpatialEncoder
label_desc: Use image node_id 1 to create a new Graphormer object from inherited base classes: nn with example: obj = Graphormer(num_classes, edge_dim, num_atoms, max_degree, num_spatial, multi_hop_max_dist, num_encoder_layers, embedding_dim, ffn_embedding_dim, num_attention_heads, dropout, pre_layernorm, activation_fn)