class_docstr: Base Recurrent
  
  Base class for all recurrent-based models. The forecasts are produced sequentially between
  windows.
  
  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 sequential windows. <br>
class_docstr_tok: ["Base","Recurrent","Base","class","for","all","recurrent-based","models",".","The","forecasts","are","produced","sequentially","between","windows",".","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","sequential","windows",".","<","br",">"]
code: def _normalization(self, batch, val_size=0, test_size=0):
      temporal = batch["temporal"]  # B, C, T
      temporal_cols = batch["temporal_cols"].copy()
      y_idx = batch["y_idx"]
  
      # Separate data and mask
      temporal_data_cols = self._get_temporal_exogenous_cols(
          temporal_cols=temporal_cols
      )
      temporal_idxs = get_indexer_raise_missing(
          temporal_cols, temporal_data_cols
      )
      temporal_idxs = np.append(y_idx, temporal_idxs)
      temporal_data = temporal[:, temporal_idxs, :]
      temporal_mask = temporal[
          :, temporal_cols.get_loc("available_mask"), :
      ].clone()
  
      # Remove validation and test set to prevent leakeage
      if val_size + test_size > 0:
          cutoff = val_size + test_size
          temporal_mask[:, -cutoff:] = 0
  
      # Normalize. self.scaler stores the shift and scale for inverse transform
      temporal_mask = temporal_mask.unsqueeze(
          1
      )  # Add channel dimension for scaler.transform.
      temporal_data = self.scaler.transform(
          x=temporal_data, mask=temporal_mask
      )
  
      # Replace values in windows dict
      temporal[:, temporal_idxs, :] = temporal_data
      batch["temporal"] = temporal
  
      return batch
  
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 6 for calling the BaseRecurrent obj's underlying member method code with example usage: obj._normalization(batch, val_size, test_size) and returns: batch