docstr: Graph Convolutional Networks
  
  Parameters
  ----------
  data_info : dict
      The information about the input dataset.
  embed_size : int
      The dimension of created embedding table. -1 means using original node embedding
  hidden_size : int
      Hidden size.
  num_layers : int
      Number of layers.
  norm : str
      GCN normalization type. Can be 'both', 'right', 'left', 'none'.
  activation : str
      Activation function.
  dropout : float
      Dropout rate.
  use_edge_weight : bool
      If true, scale the messages by edge weights.
docstr_tok: ["Graph","Convolutional","Networks","Parameters","--","--","--","--","--","data_info",":","dict","The","information","about","the","input","dataset",".","embed_size",":","int","The","dimension","of","created","embedding","table",".","-1","means","using","original","node","embedding","hidden_size",":","int","Hidden","size",".","num_layers",":","int","Number","of","layers",".","norm",":","str","GCN","normalization","type",".","Can","be","'both","'",",","'right","'",",","'left","'",",","'none","'",".","activation",":","str","Activation","function",".","dropout",":","float","Dropout","rate",".","use_edge_weight",":","bool","If","true",",","scale","the","messages","by","edge","weights","."]
code: def __init__(
      self,
      data_info: dict,
      embed_size: int = -1,
      hidden_size: int = 16,
      num_layers: int = 1,
      norm: str = "both",
      activation: str = "relu",
      dropout: float = 0.5,
      use_edge_weight: bool = False,
  ):
      """Graph Convolutional Networks
  
      Parameters
      ----------
      data_info : dict
          The information about the input dataset.
      embed_size : int
          The dimension of created embedding table. -1 means using original node embedding
      hidden_size : int
          Hidden size.
      num_layers : int
          Number of layers.
      norm : str
          GCN normalization type. Can be 'both', 'right', 'left', 'none'.
      activation : str
          Activation function.
      dropout : float
          Dropout rate.
      use_edge_weight : bool
          If true, scale the messages by edge weights.
      """
      super().__init__()
      self.use_edge_weight = use_edge_weight
      self.data_info = data_info
      self.embed_size = embed_size
      self.layers = nn.ModuleList()
      if embed_size > 0:
          self.embed = nn.Embedding(data_info["num_nodes"], embed_size)
          in_size = embed_size
      else:
          in_size = data_info["in_size"]
  
      for i in range(num_layers):
          in_hidden = hidden_size if i > 0 else in_size
          out_hidden = (
              hidden_size
              if i < num_layers - 1
              else data_info["out_size"]
          )
  
          self.layers.append(
              dgl.nn.GraphConv(
                  in_hidden,
                  out_hidden,
                  norm=norm,
                  allow_zero_in_degree=True,
              )
          )
  
      self.dropout = nn.Dropout(p=dropout)
      self.act = getattr(torch, activation)
  
file_path: dgl/dglgo/dglgo/model/node_encoder/gcn.py
imports: import dgl
  import torch
  import torch.nn
  from dgl.base import dgl_warning
label_desc: Use image node_id 1 to create a new GCN object from inherited base classes: nn with example: obj = GCN(data_info, embed_size, hidden_size, num_layers, norm, activation, dropout, use_edge_weight)