class_docstr: TimesNet
  
  The TimesNet univariate model tackles the challenge of modeling multiple intraperiod and interperiod temporal variations.
  
  Parameters
  ----------
  h : int
      Forecast horizon.
  input_size : int
      Length of input window (lags).
  futr_exog_list : list of str, optional (default=None)
      Future exogenous columns.
  hist_exog_list : list of str, optional (default=None)
      Historic exogenous columns.
  stat_exog_list : list of str, optional (default=None)
      Static exogenous columns.
  exclude_insample_y : bool (default=False)
      The model skips the autoregressive features y[t-input_size:t] if True
  hidden_size : int (default=64)
      Size of embedding for embedding and encoders.
  dropout : float between [0, 1) (default=0.1)
      Dropout for embeddings.
      conv_hidden_size: int (default=64)
      Channels of the Inception block.
  top_k: int (default=5)
      Number of periods.
  num_kernels: int (default=6)
      Number of kernels for the Inception block.
  encoder_layers : int, (default=2)
      Number of encoder layers.
  loss: PyTorch module (default=MAE())
      Instantiated train loss class from [losses collection](https://nixtla.github.io/neuralforecast/losses.pytorch.html).
  valid_loss: PyTorch module (default=None, uses loss)
      Instantiated validation loss class from [losses collection](https://nixtla.github.io/neuralforecast/losses.pytorch.html).
  max_steps: int (default=1000)
      Maximum number of training steps.
  learning_rate : float (default=1e-4)
      Learning rate.
  num_lr_decays`: int (default=-1)
      Number of learning rate decays, evenly distributed across max_steps. If -1, no learning rate decay is performed.
  early_stop_patience_steps : int (default=-1)
      Number of validation iterations before early stopping. If -1, no early stopping is performed.
  val_check_steps : int (default=100)
      Number of training steps between every validation loss check.
  batch_size : int (default=32)
      Number of different series in each batch.
  valid_batch_size : int (default=None)
      Number of different series in each validation and test batch, if None uses batch_size.
  windows_batch_size : int (default=64)
      Number of windows to sample in each training batch.
  inference_windows_batch_size : int (default=256)
      Number of windows to sample in each inference batch.
  start_padding_enabled : bool (default=False)
      If True, the model will pad the time series with zeros at the beginning by input size.
  scaler_type : str (default='standard')
      Type of scaler for temporal inputs normalization see [temporal scalers](https://nixtla.github.io/neuralforecast/common.scalers.html).<br>
  random_seed : int (default=1)
      Random_seed for pytorch initializer and numpy generators.
  num_workers_loader : int (default=0)
      Workers to be used by `TimeSeriesDataLoader`.
  drop_last_loader : bool (default=False)
      If True `TimeSeriesDataLoader` drops last non-full batch.
  **trainer_kwargs
      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)
  
      References
      ----------
  Haixu Wu and Tengge Hu and Yong Liu and Hang Zhou and Jianmin Wang and Mingsheng Long. TimesNet: Temporal 2D-Variation Modeling for General Time Series Analysis. https://openreview.net/pdf?id=ju_Uqw384Oq
class_docstr_tok: ["TimesNet","The","TimesNet","univariate","model","tackles","the","challenge","of","modeling","multiple","intraperiod","and","interperiod","temporal","variations",".","Parameters","--","--","--","--","--","h",":","int","Forecast","horizon",".","input_size",":","int","Length","of","input","window","(","lags",")",".","futr_exog_list",":","list","of","str",",","optional","(","default=None",")","Future","exogenous","columns",".","hist_exog_list",":","list","of","str",",","optional","(","default=None",")","Historic","exogenous","columns",".","stat_exog_list",":","list","of","str",",","optional","(","default=None",")","Static","exogenous","columns",".","exclude_insample_y",":","bool","(","default=False",")","The","model","skips","the","autoregressive","features","y","[","t-input_size",":","t","]","if","True","hidden_size",":","int","(","default=64",")","Size","of","embedding","for","embedding","and","encoders",".","dropout",":","float","between","[","0",",","1",")","(","default=0.1",")","Dropout","for","embeddings",".","conv_hidden_size",":","int","(","default=64",")","Channels","of","the","Inception","block",".","top_k",":","int","(","default=5",")","Number","of","periods",".","num_kernels",":","int","(","default=6",")","Number","of","kernels","for","the","Inception","block",".","encoder_layers",":","int",",","(","default=2",")","Number","of","encoder","layers",".","loss",":","PyTorch","module","(","default=MAE","(",")",")","Instantiated","train","loss","class","from","[","losses","collection","]","(","https",":","\/\/nixtla.github.io\/neuralforecast\/losses.pytorch.html",")",".","valid_loss",":","PyTorch","module","(","default=None",",","uses","loss",")","Instantiated","validation","loss","class","from","[","losses","collection","]","(","https",":","\/\/nixtla.github.io\/neuralforecast\/losses.pytorch.html",")",".","max_steps",":","int","(","default=1000",")","Maximum","number","of","training","steps",".","learning_rate",":","float","(","default=1e-4",")","Learning","rate",".","num_lr_decays","`",":","int","(","default=-1",")","Number","of","learning","rate","decays",",","evenly","distributed","across","max_steps",".","If","-1",",","no","learning","rate","decay","is","performed",".","early_stop_patience_steps",":","int","(","default=-1",")","Number","of","validation","iterations","before","early","stopping",".","If","-1",",","no","early","stopping","is","performed",".","val_check_steps",":","int","(","default=100",")","Number","of","training","steps","between","every","validation","loss","check",".","batch_size",":","int","(","default=32",")","Number","of","different","series","in","each","batch",".","valid_batch_size",":","int","(","default=None",")","Number","of","different","series","in","each","validation","and","test","batch",",","if","None","uses","batch_size",".","windows_batch_size",":","int","(","default=64",")","Number","of","windows","to","sample","in","each","training","batch",".","inference_windows_batch_size",":","int","(","default=256",")","Number","of","windows","to","sample","in","each","inference","batch",".","start_padding_enabled",":","bool","(","default=False",")","If","True",",","the","model","will","pad","the","time","series","with","zeros","at","the","beginning","by","input","size",".","scaler_type",":","str","(","default='standard","'",")","Type","of","scaler","for","temporal","inputs","normalization","see","[","temporal","scalers","]","(","https",":","\/\/nixtla.github.io\/neuralforecast\/common.scalers.html",")",".","<","br",">","random_seed",":","int","(","default=1",")","Random_seed","for","pytorch","initializer","and","numpy","generators",".","num_workers_loader",":","int","(","default=0",")","Workers","to","be","used","by","`","TimeSeriesDataLoader","`",".","drop_last_loader",":","bool","(","default=False",")","If","True","`","TimeSeriesDataLoader","`","drops","last","non-full","batch",".","*","*","trainer_kwargs","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",")","References","--","--","--","--","--","Haixu","Wu","and","Tengge","Hu","and","Yong","Liu","and","Hang","Zhou","and","Jianmin","Wang","and","Mingsheng","Long",".","TimesNet",":","Temporal","2D-Variation","Modeling","for","General","Time","Series","Analysis",".","https",":","\/\/openreview.net\/pdf","?","id=ju_Uqw384Oq"]
code: def forward(self, windows_batch):
      # Parse windows_batch
      insample_y = windows_batch["insample_y"]
      # insample_mask = windows_batch['insample_mask']
      # hist_exog     = windows_batch['hist_exog']
      # stat_exog     = windows_batch['stat_exog']
      futr_exog = windows_batch["futr_exog"]
  
      # Parse inputs
      insample_y = insample_y.unsqueeze(-1)  # [Ws,L,1]
      if self.futr_input_size > 0:
          x_mark_enc = futr_exog[:, : self.input_size, :]
      else:
          x_mark_enc = None
  
      # embedding
      enc_out = self.enc_embedding(insample_y, x_mark_enc)
      enc_out = self.predict_linear(enc_out.permute(0, 2, 1)).permute(
          0, 2, 1
      )  # align temporal dimension
      # TimesNet
      for i in range(self.encoder_layers):
          enc_out = self.layer_norm(self.model[i](enc_out))
      # porject back
      dec_out = self.projection(enc_out)
  
      forecast = self.loss.domain_map(dec_out[:, -self.h :])
      return forecast
  
imports: from typing import Optional
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.fft
  from ..common._modules import DataEmbedding
  from ..common._base_windows import BaseWindows
  from ..losses.pytorch import MAE
label_desc: Use image node_id 2 for calling the TimesNet obj's underlying member method code with example usage: obj.forward(windows_batch) and returns: forecast