code: def __init__(
      self,
      input_size: int,
      freq: str,
      prediction_length: int,
      target_dim: int,
      trainer: Trainer = Trainer(),
      context_length: Optional[int] = None,
      num_layers: int = 2,
      num_cells: int = 40,
      cell_type: str = "LSTM",
      num_parallel_samples: int = 100,
      dropout_rate: float = 0.1,
      use_feat_dynamic_real: bool = False,
      use_feat_static_cat: bool = False,
      use_feat_static_real: bool = False,
      cardinality: Optional[List[int]] = None,
      embedding_dimension: Optional[List[int]] = None,
      distr_output: Optional[DistributionOutput] = None,
      rank: Optional[int] = 5,
      scaling: bool = True,
      pick_incomplete: bool = False,
      lags_seq: Optional[List[int]] = None,
      time_features: Optional[List[TimeFeature]] = None,
      conditioning_length: int = 200,
      use_marginal_transformation=False,
      **kwargs,
  ) -> None:
      super().__init__(trainer=trainer, **kwargs)
  
      self.freq = freq
      self.context_length = (
          context_length
          if context_length is not None
          else prediction_length
      )
  
      if distr_output is not None:
          self.distr_output = distr_output
      else:
          self.distr_output = LowRankMultivariateNormalOutput(
              dim=target_dim, rank=rank
          )
  
      self.input_size = input_size
      self.prediction_length = prediction_length
      self.target_dim = target_dim
      self.num_layers = num_layers
      self.num_cells = num_cells
      self.cell_type = cell_type
      self.num_parallel_samples = num_parallel_samples
      self.dropout_rate = dropout_rate
      self.use_feat_dynamic_real = use_feat_dynamic_real
      self.use_feat_static_cat = use_feat_static_cat
      self.use_feat_static_real = use_feat_static_real
      self.cardinality = (
          cardinality if cardinality and use_feat_static_cat else [1]
      )
      self.embedding_dimension = (
          embedding_dimension
          if embedding_dimension is not None
          else [min(50, (cat + 1) // 2) for cat in self.cardinality]
      )
      self.conditioning_length = conditioning_length
      self.use_marginal_transformation = use_marginal_transformation
  
      self.lags_seq = (
          lags_seq
          if lags_seq is not None
          else lags_for_fourier_time_features_from_frequency(
              freq_str=freq
          )
      )
  
      self.time_features = (
          time_features
          if time_features is not None
          else fourier_time_features_from_frequency(self.freq)
      )
  
      self.history_length = self.context_length + max(self.lags_seq)
      self.pick_incomplete = pick_incomplete
      self.scaling = scaling
  
      if self.use_marginal_transformation:
          self.output_transform: Optional[
              Callable
          ] = cdf_to_gaussian_forward_transform
      else:
          self.output_transform = None
  
      self.train_sampler = ExpectedNumInstanceSampler(
          num_instances=1.0,
          min_past=0 if pick_incomplete else self.history_length,
          min_future=prediction_length,
      )
  
      self.validation_sampler = ValidationSplitSampler(
          min_past=0 if pick_incomplete else self.history_length,
          min_future=prediction_length,
      )
  
imports: from typing import List, Optional, Callable
  import numpy
  import torch
  from gluonts.core.component import validated
  from gluonts.dataset.field_names import FieldName
  from gluonts.time_feature import TimeFeature
  from gluonts.torch.modules.distribution_output import DistributionOutput
  from gluonts.torch.util import copy_parameters
  from gluonts.torch.model.predictor import PyTorchPredictor
  from gluonts.model.predictor import Predictor
  from gluonts.transform import AddObservedValuesIndicator, AddTimeFeatures, AsNumpyArray, CDFtoGaussianTransform, Chain, ExpandDimArray, ExpectedNumInstanceSampler, InstanceSplitter, ValidationSplitSampler, TestSplitSampler, RenameFields, SetField, TargetDimIndicator, Transformation, VstackFeatures, RemoveFields, AddAgeFeature, cdf_to_gaussian_forward_transform
  from pts import Trainer
  from pts.model.utils import get_module_forward_input_names
  from pts.feature import fourier_time_features_from_frequency, lags_for_fourier_time_features_from_frequency
  from pts.model import PyTorchEstimator
  from pts.modules import LowRankMultivariateNormalOutput
  from .deepvar_network import DeepVARTrainingNetwork, DeepVARPredictionNetwork
label_desc: Use image node_id 1 to create a new DeepVAREstimator object from inherited base classes: PyTorchEstimator with example: obj = DeepVAREstimator(input_size, freq, prediction_length, target_dim, trainer, context_length, num_layers, num_cells, cell_type, num_parallel_samples, dropout_rate, use_feat_dynamic_real, use_feat_static_cat, use_feat_static_real, cardinality, embedding_dimension, distr_output, rank, scaling, pick_incomplete, lags_seq, time_features, conditioning_length, use_marginal_transformation)