class_docstr: Implementaion of Deep AR model
class_docstr_tok: ["Implementaion","of","Deep","AR","model"]
code: def forward(
      self, past, past_timestamp, future_timestamp, mean_samples=True
  ):
      _, states = self.unroll_encoder(
          past, past_timestamp, future_timestamp
      )
  
      forecast_samples = self.sampling_decoder(
          past=past,
          time_features=future_timestamp,
          begin_states=states,
      )
  
      target_idx = self.config.target_seq_index
      if target_idx is not None:
          forecast_samples = forecast_samples[
              :, :, :, target_idx : target_idx + 1
          ]
  
      return (
          forecast_samples.mean(dim=1)
          if mean_samples
          else forecast_samples
      )
  
imports: import copy
  import logging
  import math
  import numpy
  import pandas
  from typing import List, Optional, Tuple, Union
  from merlion.utils.misc import initializer
  from merlion.models.base import NormalizingConfig
  from merlion.models.deep_base import TorchModel, LossFunction
  from merlion.models.forecast.deep_base import DeepForecasterConfig, DeepForecaster
label_desc: Use image node_id 6 for calling the DeepARModel obj's underlying member method code with example usage: obj.forward(past, past_timestamp, future_timestamp, mean_samples) and returns: unknown