code: def __init__(
      self,
      input_dim,
      pretraining_ratio=0.2,
      n_d=8,
      n_a=8,
      n_steps=3,
      gamma=1.3,
      cat_idxs=[],
      cat_dims=[],
      cat_emb_dim=1,
      n_independent=2,
      n_shared=2,
      epsilon=1e-15,
      virtual_batch_size=128,
      momentum=0.02,
      mask_type="sparsemax",
      n_shared_decoder=1,
      n_indep_decoder=1,
      group_attention_matrix=None,
  ):
      super(TabNetPretraining, self).__init__()
  
      self.cat_idxs = cat_idxs or []
      self.cat_dims = cat_dims or []
      self.cat_emb_dim = cat_emb_dim
  
      self.input_dim = input_dim
      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.mask_type = mask_type
      self.pretraining_ratio = pretraining_ratio
      self.n_shared_decoder = n_shared_decoder
      self.n_indep_decoder = n_indep_decoder
  
      if self.n_steps <= 0:
          raise ValueError("n_steps should be a positive integer.")
      if self.n_independent == 0 and self.n_shared == 0:
          raise ValueError(
              "n_shared and n_independent can't be both zero."
          )
  
      self.virtual_batch_size = virtual_batch_size
      self.embedder = EmbeddingGenerator(
          input_dim,
          cat_dims,
          cat_idxs,
          cat_emb_dim,
          group_attention_matrix,
      )
      self.post_embed_dim = self.embedder.post_embed_dim
  
      self.masker = RandomObfuscator(
          self.pretraining_ratio,
          group_matrix=self.embedder.embedding_group_matrix,
      )
      self.encoder = TabNetEncoder(
          input_dim=self.post_embed_dim,
          output_dim=self.post_embed_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=self.embedder.embedding_group_matrix,
      )
      self.decoder = TabNetDecoder(
          self.post_embed_dim,
          n_d=n_d,
          n_steps=n_steps,
          n_independent=self.n_indep_decoder,
          n_shared=self.n_shared_decoder,
          virtual_batch_size=virtual_batch_size,
          momentum=momentum,
      )
  
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 TabNetPretraining object from inherited base classes: torch.nn with example: obj = TabNetPretraining(input_dim, pretraining_ratio, n_d, n_a, n_steps, gamma, cat_idxs, cat_dims, cat_emb_dim, n_independent, n_shared, epsilon, virtual_batch_size, momentum, mask_type, n_shared_decoder, n_indep_decoder, group_attention_matrix)