class_docstr: Base Windows
  
  Base class for all windows-based models. The forecasts are produced separately
  for each window, which are randomly sampled during training.
  
  This class implements the basic functionality for all windows-based models, including:
  - PyTorch Lightning's methods training_step, validation_step, predict_step.<br>
  - fit and predict methods used by NeuralForecast.core class.<br>
  - sampling and wrangling methods to generate windows.
class_docstr_tok: ["Base","Windows","Base","class","for","all","windows-based","models",".","The","forecasts","are","produced","separately","for","each","window",",","which","are","randomly","sampled","during","training",".","This","class","implements","the","basic","functionality","for","all","windows-based","models",",","including",":","-","PyTorch","Lightning","'s","methods","training_step",",","validation_step",",","predict_step.","<","br",">","-","fit","and","predict","methods","used","by","NeuralForecast.core","class.","<","br",">","-","sampling","and","wrangling","methods","to","generate","windows","."]
docstr: Decompose Predictions.
  
  Decompose the predictions through the network's layers.
  Available methods are `ESRNN`, `NHITS`, `NBEATS`, and `NBEATSx`.
  
  **Parameters:**<br>
  `dataset`: NeuralForecast's `TimeSeriesDataset`, see [documentation here](https://nixtla.github.io/neuralforecast/tsdataset.html).<br>
  `step_size`: int=1, step size between each window of temporal data.<br>
  `**data_module_kwargs`: PL's TimeSeriesDataModule args, see [documentation](https://pytorch-lightning.readthedocs.io/en/1.6.1/extensions/datamodules.html#using-a-datamodule).
docstr_tok: ["Decompose","Predictions",".","Decompose","the","predictions","through","the","network","'s","layers",".","Available","methods","are","`","ESRNN","`",",","`","NHITS","`",",","`","NBEATS","`",",","and","`","NBEATSx","`",".","*","*","Parameters",":","*","*","<","br",">","`","dataset","`",":","NeuralForecast","'s","`","TimeSeriesDataset","`",",","see","[","documentation","here","]","(","https",":","\/\/nixtla.github.io\/neuralforecast\/tsdataset.html",")",".","<","br",">","`","step_size","`",":","int=1",",","step","size","between","each","window","of","temporal","data.","<","br",">","`","*","*","data_module_kwargs","`",":","PL","'s","TimeSeriesDataModule","args",",","see","[","documentation","]","(","https",":","\/\/pytorch-lightning.readthedocs.io\/en\/1.6.1\/extensions\/datamodules.html","#","using-a-datamodule",")","."]
code: def decompose(
      self, dataset, step_size=1, random_seed=None, **data_module_kwargs
  ):
      """Decompose Predictions.
  
      Decompose the predictions through the network's layers.
      Available methods are `ESRNN`, `NHITS`, `NBEATS`, and `NBEATSx`.
  
      **Parameters:**<br>
      `dataset`: NeuralForecast's `TimeSeriesDataset`, see [documentation here](https://nixtla.github.io/neuralforecast/tsdataset.html).<br>
      `step_size`: int=1, step size between each window of temporal data.<br>
      `**data_module_kwargs`: PL's TimeSeriesDataModule args, see [documentation](https://pytorch-lightning.readthedocs.io/en/1.6.1/extensions/datamodules.html#using-a-datamodule).
      """
      # Restart random seed
      if random_seed is None:
          random_seed = self.random_seed
      torch.manual_seed(random_seed)
  
      self.predict_step_size = step_size
      self.decompose_forecast = True
      datamodule = TimeSeriesDataModule(
          dataset=dataset,
          valid_batch_size=self.valid_batch_size,
          **data_module_kwargs,
      )
      trainer = pl.Trainer(**self.trainer_kwargs)
      fcsts = trainer.predict(self, datamodule=datamodule)
      self.decompose_forecast = (
          False  # Default decomposition back to false
      )
      return torch.vstack(fcsts).numpy()
  
imports: import random
  import warnings
  import numpy
  import torch
  import torch.nn
  import pytorch_lightning
  from pytorch_lightning.callbacks import TQDMProgressBar
  from pytorch_lightning.callbacks.early_stopping import EarlyStopping
  from ._scalers import TemporalNorm
  from ..tsdataset import TimeSeriesDataModule
  from ..utils import get_indexer_raise_missing
label_desc: Use image node_id 17 for calling the BaseWindows obj's underlying member method code with example usage: obj.decompose(dataset, step_size, random_seed) and returns: torch