class_docstr: MLP with linear output
class_docstr_tok: ["MLP","with","linear","output"]
docstr: MLP layers construction
  
  Paramters
  ---------
  num_layers: int
      The number of linear layers
  input_dim: int
      The dimensionality of input features
  hidden_dim: int
      The dimensionality of hidden units at ALL layers
  output_dim: int
      The number of classes for prediction
docstr_tok: ["MLP","layers","construction","Paramters","--","--","--","--","-","num_layers",":","int","The","number","of","linear","layers","input_dim",":","int","The","dimensionality","of","input","features","hidden_dim",":","int","The","dimensionality","of","hidden","units","at","ALL","layers","output_dim",":","int","The","number","of","classes","for","prediction"]
code: def __init__(self, num_layers, input_dim, hidden_dim, output_dim):
      """MLP layers construction
  
      Paramters
      ---------
      num_layers: int
          The number of linear layers
      input_dim: int
          The dimensionality of input features
      hidden_dim: int
          The dimensionality of hidden units at ALL layers
      output_dim: int
          The number of classes for prediction
      """
      super(MLP, self).__init__()
      self.linear_or_not = True
      self.num_layers = num_layers
      self.output_dim = output_dim
  
      with self.name_scope():
          if num_layers < 1:
              raise ValueError("number of layers should be positive!")
          elif num_layers == 1:
              # Linear model
              self.linear = nn.Dense(output_dim, in_units=input_dim)
          else:
              self.linear_or_not = False
              self.linears = nn.Sequential()
              self.batch_norms = nn.Sequential()
  
              self.linears.add(nn.Dense(hidden_dim, in_units=input_dim))
              for layer in range(num_layers - 2):
                  self.linears.add(
                      nn.Dense(hidden_dim, in_units=hidden_dim)
                  )
              self.linears.add(
                  nn.Dense(output_dim, in_units=hidden_dim)
              )
  
              for layer in range(num_layers - 1):
                  self.batch_norms.add(
                      nn.BatchNorm(in_channels=hidden_dim)
                  )
  
file_path: dgl/examples/mxnet/gin/gin.py
imports: import mxnet
  from dgl.nn.mxnet.conv import GINConv
  from dgl.nn.mxnet.glob import AvgPooling, MaxPooling, SumPooling
  from mxnet import gluon, nd
  from mxnet.gluon import nn
label_desc: Use image node_id 1 to create a new MLP object from inherited base classes: nn with example: obj = MLP(num_layers, input_dim, hidden_dim, output_dim)