docstr: Pytorch module implementing the Residual Block from the TiDE paper.
docstr_tok: ["Pytorch","module","implementing","the","Residual","Block","from","the","TiDE","paper","."]
code: def __init__(
      self,
      input_dim: int,
      output_dim: int,
      hidden_size: int,
      dropout: float,
      use_layer_norm: bool,
  ):
      """Pytorch module implementing the Residual Block from the TiDE paper."""
      super().__init__()
  
      # dense layer with ReLU activation with dropout
      self.dense = nn.Sequential(
          nn.Linear(input_dim, hidden_size),
          nn.ReLU(),
          nn.Linear(hidden_size, output_dim),
          nn.Dropout(dropout),
      )
  
      # linear skip connection from input to output of self.dense
      self.skip = nn.Linear(input_dim, output_dim)
  
      # layer normalization as output
      if use_layer_norm:
          self.layer_norm = nn.LayerNorm(output_dim)
      else:
          self.layer_norm = None
  
file_path: darts/darts/models/forecasting/tide_model.py
imports: from typing import Optional, Tuple
  import torch
  import torch.nn
  from darts.logging import get_logger, raise_log
  from darts.models.forecasting.pl_forecasting_module import PLMixedCovariatesModule, io_processor
  from darts.models.forecasting.torch_forecasting_model import MixedCovariatesTorchModel
label_desc: Use image node_id 1 to create a new _ResidualBlock object from inherited base classes: nn with example: obj = _ResidualBlock(input_dim, output_dim, hidden_size, dropout, use_layer_norm)