docstr: Defines main part of the TabNet network without the embedding layers.
  
  Parameters
  ----------
  input_dim : int
      Number of features
  output_dim : int or list of int for multi task classification
      Dimension of network output
      examples : one for regression, 2 for binary classification etc...
  n_d : int
      Dimension of the prediction  layer (usually between 4 and 64)
  n_a : int
      Dimension of the attention  layer (usually between 4 and 64)
  n_steps : int
      Number of successive steps in the network (usually between 3 and 10)
  gamma : float
      Float above 1, scaling factor for attention updates (usually between 1.0 to 2.0)
  n_independent : int
      Number of independent GLU layer in each GLU block (default 2)
  n_shared : int
      Number of independent GLU layer in each GLU block (default 2)
  epsilon : float
      Avoid log(0), this should be kept very low
  virtual_batch_size : int
      Batch size for Ghost Batch Normalization
  momentum : float
      Float value between 0 and 1 which will be used for momentum in all batch norm
  mask_type : str
      Either "sparsemax" or "entmax" : this is the masking function to use
  group_attention_matrix : torch matrix
      Matrix of size (n_groups, input_dim), m_ij = importance within group i of feature j
docstr_tok: ["Defines","main","part","of","the","TabNet","network","without","the","embedding","layers",".","Parameters","--","--","--","--","--","input_dim",":","int","Number","of","features","output_dim",":","int","or","list","of","int","for","multi","task","classification","Dimension","of","network","output","examples",":","one","for","regression",",","2","for","binary","classification","etc","...","n_d",":","int","Dimension","of","the","prediction","layer","(","usually","between","4","and","64",")","n_a",":","int","Dimension","of","the","attention","layer","(","usually","between","4","and","64",")","n_steps",":","int","Number","of","successive","steps","in","the","network","(","usually","between","3","and","10",")","gamma",":","float","Float","above","1",",","scaling","factor","for","attention","updates","(","usually","between","1.0","to","2.0",")","n_independent",":","int","Number","of","independent","GLU","layer","in","each","GLU","block","(","default","2",")","n_shared",":","int","Number","of","independent","GLU","layer","in","each","GLU","block","(","default","2",")","epsilon",":","float","Avoid","log","(","0",")",",","this","should","be","kept","very","low","virtual_batch_size",":","int","Batch","size","for","Ghost","Batch","Normalization","momentum",":","float","Float","value","between","0","and","1","which","will","be","used","for","momentum","in","all","batch","norm","mask_type",":","str","Either","``","sparsemax","''","or","``","entmax","''",":","this","is","the","masking","function","to","use","group_attention_matrix",":","torch","matrix","Matrix","of","size","(","n_groups",",","input_dim",")",",","m_ij","=","importance","within","group","i","of","feature","j"]
code: def __init__(
      self,
      input_dim,
      output_dim,
      n_d=8,
      n_a=8,
      n_steps=3,
      gamma=1.3,
      n_independent=2,
      n_shared=2,
      epsilon=1e-15,
      virtual_batch_size=128,
      momentum=0.02,
      mask_type="sparsemax",
      group_attention_matrix=None,
  ):
      """
      Defines main part of the TabNet network without the embedding layers.
  
      Parameters
      ----------
      input_dim : int
          Number of features
      output_dim : int or list of int for multi task classification
          Dimension of network output
          examples : one for regression, 2 for binary classification etc...
      n_d : int
          Dimension of the prediction  layer (usually between 4 and 64)
      n_a : int
          Dimension of the attention  layer (usually between 4 and 64)
      n_steps : int
          Number of successive steps in the network (usually between 3 and 10)
      gamma : float
          Float above 1, scaling factor for attention updates (usually between 1.0 to 2.0)
      n_independent : int
          Number of independent GLU layer in each GLU block (default 2)
      n_shared : int
          Number of independent GLU layer in each GLU block (default 2)
      epsilon : float
          Avoid log(0), this should be kept very low
      virtual_batch_size : int
          Batch size for Ghost Batch Normalization
      momentum : float
          Float value between 0 and 1 which will be used for momentum in all batch norm
      mask_type : str
          Either "sparsemax" or "entmax" : this is the masking function to use
      group_attention_matrix : torch matrix
          Matrix of size (n_groups, input_dim), m_ij = importance within group i of feature j
      """
      super(TabNetNoEmbeddings, self).__init__()
      self.input_dim = input_dim
      self.output_dim = output_dim
      self.is_multi_task = isinstance(output_dim, list)
      self.n_d = n_d
      self.n_a = n_a
      self.n_steps = n_steps
      self.gamma = gamma
      self.epsilon = epsilon
      self.n_independent = n_independent
      self.n_shared = n_shared
      self.virtual_batch_size = virtual_batch_size
      self.mask_type = mask_type
      self.initial_bn = BatchNorm1d(self.input_dim, momentum=0.01)
  
      self.encoder = TabNetEncoder(
          input_dim=input_dim,
          output_dim=output_dim,
          n_d=n_d,
          n_a=n_a,
          n_steps=n_steps,
          gamma=gamma,
          n_independent=n_independent,
          n_shared=n_shared,
          epsilon=epsilon,
          virtual_batch_size=virtual_batch_size,
          momentum=momentum,
          mask_type=mask_type,
          group_attention_matrix=group_attention_matrix,
      )
  
      if self.is_multi_task:
          self.multi_task_mappings = torch.nn.ModuleList()
          for task_dim in output_dim:
              task_mapping = Linear(n_d, task_dim, bias=False)
              initialize_non_glu(task_mapping, n_d, task_dim)
              self.multi_task_mappings.append(task_mapping)
      else:
          self.final_mapping = Linear(n_d, output_dim, bias=False)
          initialize_non_glu(self.final_mapping, n_d, output_dim)
  
imports: import torch
  from torch.nn import Linear, BatchNorm1d, ReLU
  import numpy
  from pytorch_tabnet import sparsemax
label_desc: Use image node_id 1 to create a new TabNetNoEmbeddings object from inherited base classes: torch.nn with example: obj = TabNetNoEmbeddings(input_dim, output_dim, n_d, n_a, n_steps, gamma, n_independent, n_shared, epsilon, virtual_batch_size, momentum, mask_type, group_attention_matrix)