docstr: Instantiates a Torch neural network.
  
  Parameters
  ----------
  dim_layers : tuple[int]
      Tuple of integers representing the dimensions of each hidden layer.
  activation_type : nn.Module
      Torch activation function module to be used in the hidden layers.
  dropout_rate : float
      Dropout rate for dropout regularization in hidden layers.
  batch_norm : bool, optional
      Whether to apply batch normalization to the hidden layers. Default is True.
  seed : int, optional
      Random seed for weight initialization. Default is 42.
  device : str, optional
      Device to use for training. Default is "cuda:1".
docstr_tok: ["Instantiates","a","Torch","neural","network",".","Parameters","--","--","--","--","--","dim_layers",":","tuple","[","int","]","Tuple","of","integers","representing","the","dimensions","of","each","hidden","layer",".","activation_type",":","nn.Module","Torch","activation","function","module","to","be","used","in","the","hidden","layers",".","dropout_rate",":","float","Dropout","rate","for","dropout","regularization","in","hidden","layers",".","batch_norm",":","bool",",","optional","Whether","to","apply","batch","normalization","to","the","hidden","layers",".","Default","is","True",".","seed",":","int",",","optional","Random","seed","for","weight","initialization",".","Default","is","42.","device",":","str",",","optional","Device","to","use","for","training",".","Default","is","``","cuda:1","''","."]
code: def __init__(
      self,
      dim_layers: tuple[int],
      activation_type: nn.Module,
      dropout_rate: float,
      batch_norm: bool = True,
      seed: int = 42,
      device: str = "cuda:1",
  ) -> None:
      """Instantiates a Torch neural network.
  
      Parameters
      ----------
      dim_layers : tuple[int]
          Tuple of integers representing the dimensions of each hidden layer.
      activation_type : nn.Module
          Torch activation function module to be used in the hidden layers.
      dropout_rate : float
          Dropout rate for dropout regularization in hidden layers.
      batch_norm : bool, optional
          Whether to apply batch normalization to the hidden layers. Default is True.
      seed : int, optional
          Random seed for weight initialization. Default is 42.
      device : str, optional
          Device to use for training. Default is "cuda:1".
      """
      super().__init__()
  
      self.device = torch.device(
          device if torch.cuda.is_available() else "cpu"
      )
      self.to(self.device)
      self.seed = seed
      self.layers = nn.ModuleList()
  
      self.dim_layers = dim_layers
      self.activation_type = activation_type()
      self.dropout_rate = dropout_rate
      self.batch_norm = batch_norm
  
file_path: aequitas/src/aequitas/fairflow/methods/base_estimator/neural_network.py
imports: from typing import Optional
  import pandas
  import torch
  from torch import nn, optim
  from torch.utils.data import DataLoader
  from tqdm import tqdm
  from ...utils import create_logger, import_object
  from .base_estimator import BaseEstimator
label_desc: Use image node_id 1 to create a new TorchNeuralNetwork object from inherited base classes: nn with example: obj = TorchNeuralNetwork(dim_layers, activation_type, dropout_rate, batch_norm, seed, device)