class_docstr: Custom Head for GATE.
  
  Args:
      input_dim (int): Input dimension of the head
      hparams (DictConfig): Config of the model
class_docstr_tok: ["Custom","Head","for","GATE",".","Args",":","input_dim","(","int",")",":","Input","dimension","of","the","head","hparams","(","DictConfig",")",":","Config","of","the","model"]
code: def __init__(self, input_dim: int, hparams: DictConfig):
      super().__init__()
      self.hparams = hparams
      self.input_dim = input_dim
      if self.hparams.share_head_weights:
          self.head = self._get_head_from_config()
      else:
          self.head = nn.ModuleList(
              [
                  self._get_head_from_config()
                  for _ in range(self.hparams.num_trees)
              ]
          )
      # random parameter with num_trees elements
      self.eta = nn.Parameter(
          torch.rand(self.hparams.num_trees, requires_grad=True)
      )
      if self.hparams.task == "regression":
          self.T0 = nn.Parameter(
              torch.rand(self.hparams.output_dim), requires_grad=True
          )
  
imports: import torch
  import torch.nn
  from omegaconf import DictConfig
  from pytorch_tabular.models.common.heads import blocks
  from pytorch_tabular.models.common.layers import Add, Embedding1dLayer, GatedFeatureLearningUnit, NeuralDecisionTree
  from pytorch_tabular.models.common.layers.activations import entmax15, entmoid15, sparsemax, sparsemoid, t_softmax
  from pytorch_tabular.utils import get_logger
  from ..base_model import BaseModel
label_desc: Use image node_id 1 to create a new CustomHead object from inherited base classes: nn with example: obj = CustomHead(input_dim, hparams)