docstr: Base Model for PyTorch Tabular.
  
  Args:
      config (DictConfig): The configuration for the model.
      custom_loss (Optional[torch.nn.Module], optional): A custom loss function. Defaults to None.
      custom_metrics (Optional[List[Callable]], optional): A list of custom metrics. Defaults to None.
      custom_metrics_prob_inputs (Optional[List[bool]], optional): A list of boolean values indicating whether the
          metric requires probability inputs. Defaults to None.
      custom_optimizer (Optional[torch.optim.Optimizer], optional):
          A custom optimizer as callable or string to be imported. Defaults to None.
      custom_optimizer_params (Dict, optional): A dictionary of custom optimizer parameters. Defaults to {}.
      kwargs (Dict, optional): Additional keyword arguments.
code: def __init__(
      self,
      config: DictConfig,
      custom_loss: Optional[torch.nn.Module] = None,
      custom_metrics: Optional[List[Callable]] = None,
      custom_metrics_prob_inputs: Optional[List[bool]] = None,
      custom_optimizer: Optional[torch.optim.Optimizer] = None,
      custom_optimizer_params: Dict = {},
      **kwargs,
  ):
      """Base Model for PyTorch Tabular.
  
      Args:
          config (DictConfig): The configuration for the model.
          custom_loss (Optional[torch.nn.Module], optional): A custom loss function. Defaults to None.
          custom_metrics (Optional[List[Callable]], optional): A list of custom metrics. Defaults to None.
          custom_metrics_prob_inputs (Optional[List[bool]], optional): A list of boolean values indicating whether the
              metric requires probability inputs. Defaults to None.
          custom_optimizer (Optional[torch.optim.Optimizer], optional):
              A custom optimizer as callable or string to be imported. Defaults to None.
          custom_optimizer_params (Dict, optional): A dictionary of custom optimizer parameters. Defaults to {}.
          kwargs (Dict, optional): Additional keyword arguments.
      """
      super().__init__()
      assert (
          "inferred_config" in kwargs
      ), "inferred_config not found in initialization arguments"
      inferred_config = kwargs["inferred_config"]
      # Merging the config and inferred config
      config = safe_merge_config(config, inferred_config)
      self.custom_loss = custom_loss
      self.custom_metrics = custom_metrics
      self.custom_metrics_prob_inputs = custom_metrics_prob_inputs
      self.custom_optimizer = custom_optimizer
      self.custom_optimizer_params = custom_optimizer_params
      self.kwargs = kwargs
      # Updating config with custom parameters for experiment tracking
      if self.custom_loss is not None:
          config.loss = str(self.custom_loss)
      if self.custom_metrics is not None:
          # Adding metrics to config for hparams logging and tracking
          config.metrics = []
          config.metrics_params = []
          for metric in self.custom_metrics:
              if isinstance(metric, partial):
                  # extracting func names from partial functions
                  config.metrics.append(metric.func.__name__)
                  config.metrics_params.append(metric.keywords)
              else:
                  config.metrics.append(metric.__name__)
                  config.metrics_params.append(vars(metric))
          if config.task == "classification":
              config.metrics_prob_input = (
                  self.custom_metrics_prob_inputs
              )
      # Updating default metrics in config
      elif config.task == "classification":
          # Adding metric_params to config for classification task
          for i, mp in enumerate(config.metrics_params):
              # For classification task, output_dim == number of classses
              config.metrics_params[i]["task"] = mp.get(
                  "task", "multiclass"
              )
              config.metrics_params[i]["num_classes"] = mp.get(
                  "num_classes", inferred_config.output_dim
              )
              if config.metrics[i] in (
                  "accuracy",
                  "precision",
                  "recall",
                  "precision_recall",
                  "specificity",
                  "f1_score",
                  "fbeta_score",
              ):
                  config.metrics_params[i]["top_k"] = mp.get("top_k", 1)
  
      if self.custom_optimizer is not None:
          config.optimizer = str(
              self.custom_optimizer.__class__.__name__
          )
      if len(self.custom_optimizer_params) > 0:
          config.optimizer_params = self.custom_optimizer_params
      self.save_hyperparameters(config)
      # The concatenated output dim of the embedding layer
      self._build_network()
      self._setup_loss()
      self._setup_metrics()
      self._check_and_verify()
      self.do_log_logits = (
          hasattr(self.hparams, "log_logits")
          and self.hparams.log_logits
          and self.hparams.log_target == "wandb"
      )
      if self.do_log_logits:
          self._val_logits = []
      if not WANDB_INSTALLED and self.do_log_logits:
          self.do_log_logits = False
          warnings.warn(
              "Wandb is not installed. Please install wandb to log logits. "
              "You can install wandb using pip install wandb or install PyTorch Tabular"
              " using pip install pytorch-tabular[extra]"
          )
      if not PLOTLY_INSTALLED and self.do_log_logits:
          self.do_log_logits = False
          warnings.warn(
              "Plotly is not installed. Please install plotly to log logits. "
              "You can install plotly using pip install plotly or install PyTorch Tabular"
              " using pip install pytorch-tabular[extra]"
          )
  
imports: import importlib
  import warnings
  from abc import ABCMeta, abstractmethod
  from functools import partial
  from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
  import numpy
  import pytorch_lightning
  import torch
  import torch.nn
  import torchmetrics
  from omegaconf import DictConfig, OmegaConf
  from pandas import DataFrame
  from torch import Tensor
  from torch.optim import Optimizer
  from pytorch_tabular.models.common.heads import blocks
  from pytorch_tabular.models.common.layers import PreEncoded1dLayer
  from pytorch_tabular.utils import get_logger, reset_all_weights
label_desc: Use image node_id 1 to create a new BaseModel object from inherited base classes: pl with example: obj = BaseModel(config, custom_loss, custom_metrics, custom_metrics_prob_inputs, custom_optimizer, custom_optimizer_params)