class_docstr: An end-to-end deep learning architecture for graph classification.
  paper link: https://muhanzhang.github.io/papers/AAAI_2018_DGCNN.pdf
  
  Attributes:
      num_layers(int): num of gcn layers
      hidden_units(int): num of hidden units
      k(int, optional): The number of nodes to hold for each graph in SortPooling.
      gcn_type(str): type of gcn layer, 'gcn' for GraphConv and 'sage' for SAGEConv
      node_attributes(Tensor, optional): node attribute
      edge_weights(Tensor, optional): edge weight
      node_embedding(Tensor, optional): pre-trained node embedding
      use_embedding(bool, optional): whether to use node embedding. Note that if 'use_embedding' is set True
                           and 'node_embedding' is None, will automatically randomly initialize node embedding.
      num_nodes(int, optional): num of nodes
      dropout(float, optional): dropout rate
      max_z(int, optional): default max vocab size of node labeling, default 1000.
class_docstr_tok: ["An","end-to-end","deep","learning","architecture","for","graph","classification",".","paper","link",":","https",":","\/\/muhanzhang.github.io\/papers\/AAAI_2018_DGCNN.pdf","Attributes",":","num_layers","(","int",")",":","num","of","gcn","layers","hidden_units","(","int",")",":","num","of","hidden","units","k","(","int",",","optional",")",":","The","number","of","nodes","to","hold","for","each","graph","in","SortPooling",".","gcn_type","(","str",")",":","type","of","gcn","layer",",","'gcn","'","for","GraphConv","and","'sage","'","for","SAGEConv","node_attributes","(","Tensor",",","optional",")",":","node","attribute","edge_weights","(","Tensor",",","optional",")",":","edge","weight","node_embedding","(","Tensor",",","optional",")",":","pre-trained","node","embedding","use_embedding","(","bool",",","optional",")",":","whether","to","use","node","embedding",".","Note","that","if","'use_embedding","'","is","set","True","and","'node_embedding","'","is","None",",","will","automatically","randomly","initialize","node","embedding",".","num_nodes","(","int",",","optional",")",":","num","of","nodes","dropout","(","float",",","optional",")",":","dropout","rate","max_z","(","int",",","optional",")",":","default","max","vocab","size","of","node","labeling",",","default","1000","."]
code: def __init__(
      self,
      num_layers,
      hidden_units,
      k=10,
      gcn_type="gcn",
      node_attributes=None,
      edge_weights=None,
      node_embedding=None,
      use_embedding=False,
      num_nodes=None,
      dropout=0.5,
      max_z=1000,
  ):
      super(DGCNN, self).__init__()
      self.num_layers = num_layers
      self.dropout = dropout
      self.use_attribute = False if node_attributes is None else True
      self.use_embedding = use_embedding
      self.use_edge_weight = False if edge_weights is None else True
  
      self.z_embedding = nn.Embedding(max_z, hidden_units)
  
      if node_attributes is not None:
          self.node_attributes_lookup = nn.Embedding.from_pretrained(
              node_attributes
          )
          self.node_attributes_lookup.weight.requires_grad = False
      if edge_weights is not None:
          self.edge_weights_lookup = nn.Embedding.from_pretrained(
              edge_weights
          )
          self.edge_weights_lookup.weight.requires_grad = False
      if node_embedding is not None:
          self.node_embedding = nn.Embedding.from_pretrained(
              node_embedding
          )
          self.node_embedding.weight.requires_grad = False
      elif use_embedding:
          self.node_embedding = nn.Embedding(num_nodes, hidden_units)
  
      initial_dim = hidden_units
      if self.use_attribute:
          initial_dim += self.node_attributes_lookup.embedding_dim
      if self.use_embedding:
          initial_dim += self.node_embedding.embedding_dim
  
      self.layers = nn.ModuleList()
      if gcn_type == "gcn":
          self.layers.append(
              GraphConv(
                  initial_dim, hidden_units, allow_zero_in_degree=True
              )
          )
          for _ in range(num_layers - 1):
              self.layers.append(
                  GraphConv(
                      hidden_units,
                      hidden_units,
                      allow_zero_in_degree=True,
                  )
              )
          self.layers.append(
              GraphConv(hidden_units, 1, allow_zero_in_degree=True)
          )
      elif gcn_type == "sage":
          self.layers.append(
              SAGEConv(initial_dim, hidden_units, aggregator_type="gcn")
          )
          for _ in range(num_layers - 1):
              self.layers.append(
                  SAGEConv(
                      hidden_units, hidden_units, aggregator_type="gcn"
                  )
              )
          self.layers.append(
              SAGEConv(hidden_units, 1, aggregator_type="gcn")
          )
      else:
          raise ValueError("Gcn type error.")
  
      self.pooling = SortPooling(k=k)
      conv1d_channels = [16, 32]
      total_latent_dim = hidden_units * num_layers + 1
      conv1d_kws = [total_latent_dim, 5]
      self.conv_1 = nn.Conv1d(
          1, conv1d_channels[0], conv1d_kws[0], conv1d_kws[0]
      )
      self.maxpool1d = nn.MaxPool1d(2, 2)
      self.conv_2 = nn.Conv1d(
          conv1d_channels[0], conv1d_channels[1], conv1d_kws[1], 1
      )
      dense_dim = int((k - 2) / 2 + 1)
      dense_dim = (dense_dim - conv1d_kws[1] + 1) * conv1d_channels[1]
      self.linear_1 = nn.Linear(dense_dim, 128)
      self.linear_2 = nn.Linear(128, 1)
  
file_path: dgl/examples/pytorch/seal/model.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from dgl.nn.pytorch import GraphConv, SAGEConv, SortPooling, SumPooling
label_desc: Use image node_id 1 to create a new DGCNN object from inherited base classes: nn with example: obj = DGCNN(num_layers, hidden_units, k, gcn_type, node_attributes, edge_weights, node_embedding, use_embedding, num_nodes, dropout, max_z)