class_docstr: DilatedRNN
  
  **Parameters:**<br>
  `h`: int, forecast horizon.<br>
  `input_size`: int, maximum sequence length for truncated train backpropagation. Default -1 uses all history.<br>
  `inference_input_size`: int, maximum sequence length for truncated inference. Default -1 uses all history.<br>
  `cell_type`: str, type of RNN cell to use. Options: 'GRU', 'RNN', 'LSTM', 'ResLSTM', 'AttentiveLSTM'.<br>
  `dilations`: int list, dilations betweem layers.<br>
  `encoder_hidden_size`: int=200, units for the RNN's hidden state size.<br>
  `context_size`: int=10, size of context vector for each timestamp on the forecasting window.<br>
  `decoder_hidden_size`: int=200, size of hidden layer for the MLP decoder.<br>
  `decoder_layers`: int=2, number of layers for the MLP decoder.<br>
  `futr_exog_list`: str list, future exogenous columns.<br>
  `hist_exog_list`: str list, historic exogenous columns.<br>
  `stat_exog_list`: str list, static exogenous columns.<br>
  `loss`: PyTorch module, instantiated train loss class from [losses collection](https://nixtla.github.io/neuralforecast/losses.pytorch.html).<br>
  `valid_loss`: PyTorch module=`loss`, instantiated valid loss class from [losses collection](https://nixtla.github.io/neuralforecast/losses.pytorch.html).<br>
  `max_steps`: int, maximum number of training steps.<br>
  `learning_rate`: float, Learning rate between (0, 1).<br>
  `num_lr_decays`: int, Number of learning rate decays, evenly distributed across max_steps.<br>
  `early_stop_patience_steps`: int, Number of validation iterations before early stopping.<br>
  `val_check_steps`: int, Number of training steps between every validation loss check.<br>
  `batch_size`: int=32, number of different series in each batch.<br>
  `valid_batch_size`: int=None, number of different series in each validation and test batch.<br>
  `step_size`: int=1, step size between each window of temporal data.<br>
  `scaler_type`: str='robust', type of scaler for temporal inputs normalization see [temporal scalers](https://nixtla.github.io/neuralforecast/common.scalers.html).<br>
  `random_seed`: int=1, random_seed for pytorch initializer and numpy generators.<br>
  `num_workers_loader`: int=os.cpu_count(), workers to be used by `TimeSeriesDataLoader`.<br>
  `drop_last_loader`: bool=False, if True `TimeSeriesDataLoader` drops last non-full batch.<br>
  `alias`: str, optional,  Custom name of the model.<br>
  `**trainer_kwargs`: int,  keyword trainer arguments inherited from [PyTorch Lighning's trainer](https://pytorch-lightning.readthedocs.io/en/stable/api/pytorch_lightning.trainer.trainer.Trainer.html?highlight=trainer).<br>
class_docstr_tok: ["DilatedRNN","*","*","Parameters",":","*","*","<","br",">","`","h","`",":","int",",","forecast","horizon.","<","br",">","`","input_size","`",":","int",",","maximum","sequence","length","for","truncated","train","backpropagation",".","Default","-1","uses","all","history.","<","br",">","`","inference_input_size","`",":","int",",","maximum","sequence","length","for","truncated","inference",".","Default","-1","uses","all","history.","<","br",">","`","cell_type","`",":","str",",","type","of","RNN","cell","to","use",".","Options",":","'GRU","'",",","'RNN","'",",","'LSTM","'",",","'ResLSTM","'",",","'AttentiveLSTM'.","<","br",">","`","dilations","`",":","int","list",",","dilations","betweem","layers.","<","br",">","`","encoder_hidden_size","`",":","int=200",",","units","for","the","RNN","'s","hidden","state","size.","<","br",">","`","context_size","`",":","int=10",",","size","of","context","vector","for","each","timestamp","on","the","forecasting","window.","<","br",">","`","decoder_hidden_size","`",":","int=200",",","size","of","hidden","layer","for","the","MLP","decoder.","<","br",">","`","decoder_layers","`",":","int=2",",","number","of","layers","for","the","MLP","decoder.","<","br",">","`","futr_exog_list","`",":","str","list",",","future","exogenous","columns.","<","br",">","`","hist_exog_list","`",":","str","list",",","historic","exogenous","columns.","<","br",">","`","stat_exog_list","`",":","str","list",",","static","exogenous","columns.","<","br",">","`","loss","`",":","PyTorch","module",",","instantiated","train","loss","class","from","[","losses","collection","]","(","https",":","\/\/nixtla.github.io\/neuralforecast\/losses.pytorch.html",")",".","<","br",">","`","valid_loss","`",":","PyTorch","module=","`","loss","`",",","instantiated","valid","loss","class","from","[","losses","collection","]","(","https",":","\/\/nixtla.github.io\/neuralforecast\/losses.pytorch.html",")",".","<","br",">","`","max_steps","`",":","int",",","maximum","number","of","training","steps.","<","br",">","`","learning_rate","`",":","float",",","Learning","rate","between","(","0",",","1",")",".","<","br",">","`","num_lr_decays","`",":","int",",","Number","of","learning","rate","decays",",","evenly","distributed","across","max_steps.","<","br",">","`","early_stop_patience_steps","`",":","int",",","Number","of","validation","iterations","before","early","stopping.","<","br",">","`","val_check_steps","`",":","int",",","Number","of","training","steps","between","every","validation","loss","check.","<","br",">","`","batch_size","`",":","int=32",",","number","of","different","series","in","each","batch.","<","br",">","`","valid_batch_size","`",":","int=None",",","number","of","different","series","in","each","validation","and","test","batch.","<","br",">","`","step_size","`",":","int=1",",","step","size","between","each","window","of","temporal","data.","<","br",">","`","scaler_type","`",":","str='robust","'",",","type","of","scaler","for","temporal","inputs","normalization","see","[","temporal","scalers","]","(","https",":","\/\/nixtla.github.io\/neuralforecast\/common.scalers.html",")",".","<","br",">","`","random_seed","`",":","int=1",",","random_seed","for","pytorch","initializer","and","numpy","generators.","<","br",">","`","num_workers_loader","`",":","int=os.cpu_count","(",")",",","workers","to","be","used","by","`","TimeSeriesDataLoader","`",".","<","br",">","`","drop_last_loader","`",":","bool=False",",","if","True","`","TimeSeriesDataLoader","`","drops","last","non-full","batch.","<","br",">","`","alias","`",":","str",",","optional",",","Custom","name","of","the","model.","<","br",">","`","*","*","trainer_kwargs","`",":","int",",","keyword","trainer","arguments","inherited","from","[","PyTorch","Lighning","'s","trainer","]","(","https",":","\/\/pytorch-lightning.readthedocs.io\/en\/stable\/api\/pytorch_lightning.trainer.trainer.Trainer.html","?","highlight=trainer",")",".","<","br",">"]
code: def forward(self, windows_batch):
      # Parse windows_batch
      encoder_input = windows_batch["insample_y"]  # [B, seq_len, 1]
      futr_exog = windows_batch["futr_exog"]
      hist_exog = windows_batch["hist_exog"]
      stat_exog = windows_batch["stat_exog"]
  
      # Concatenate y, historic and static inputs
      # [B, C, seq_len, 1] -> [B, seq_len, C]
      # Contatenate [ Y_t, | X_{t-L},..., X_{t} | S ]
      batch_size, seq_len = encoder_input.shape[:2]
      if self.hist_exog_size > 0:
          hist_exog = hist_exog.permute(0, 2, 1, 3).squeeze(
              -1
          )  # [B, X, seq_len, 1] -> [B, seq_len, X]
          encoder_input = torch.cat((encoder_input, hist_exog), dim=2)
  
      if self.stat_exog_size > 0:
          stat_exog = stat_exog.unsqueeze(1).repeat(
              1, seq_len, 1
          )  # [B, S] -> [B, seq_len, S]
          encoder_input = torch.cat((encoder_input, stat_exog), dim=2)
  
      # DilatedRNN forward
      for layer_num in range(len(self.rnn_stack)):
          residual = encoder_input
          output, _ = self.rnn_stack[layer_num](encoder_input)
          if layer_num > 0:
              output += residual
          encoder_input = output
  
      if self.futr_exog_size > 0:
          futr_exog = futr_exog.permute(0, 2, 3, 1)[
              :, :, 1:, :
          ]  # [B, F, seq_len, 1+H] -> [B, seq_len, H, F]
          encoder_input = torch.cat(
              (
                  encoder_input,
                  futr_exog.reshape(batch_size, seq_len, -1),
              ),
              dim=2,
          )
  
      # Context adapter
      context = self.context_adapter(encoder_input)
      context = context.reshape(
          batch_size, seq_len, self.h, self.context_size
      )
  
      # Residual connection with futr_exog
      if self.futr_exog_size > 0:
          context = torch.cat((context, futr_exog), dim=-1)
  
      # Final forecast
      output = self.mlp_decoder(context)
      output = self.loss.domain_map(output)
  
      return output
  
imports: from typing import List, Optional
  import torch
  import torch.nn
  from ..losses.pytorch import MAE
  from ..common._base_recurrent import BaseRecurrent
  from ..common._modules import MLP
label_desc: Use image node_id 2 for calling the DilatedRNN obj's underlying member method code with example usage: obj.forward(windows_batch) and returns: output