class_docstr: Forecaster base model for lstm, seq2seq, tcn and nbeats forecasters.
class_docstr_tok: ["Forecaster","base","model","for","lstm",",","seq2seq",",","tcn","and","nbeats","forecasters","."]
docstr: Build a Generic Model using config parameters.
code: def _build_automodel(
      self, data, validation_data=None, batch_size=32, epochs=1
  ):
      """Build a Generic Model using config parameters."""
      merged_config = {
          **self.model_config,
          **self.optim_config,
          **self.loss_config,
          **self.data_config,
      }
  
      model_config_keys = list(self.model_config.keys())
      data_config_keys = list(self.data_config.keys())
      optim_config_keys = list(self.optim_config.keys())
      loss_config_keys = list(self.loss_config.keys())
  
      return GenericLightningModule(
          model_creator=self.model_creator,
          optim_creator=self.optimizer_creator,
          loss_creator=self.loss_creator,
          data=data,
          validation_data=validation_data,
          batch_size=batch_size,
          epochs=epochs,
          metrics=[
              _str2optimizer_metric(metric) for metric in self.metrics
          ],
          scheduler=None,  # TODO
          num_processes=self.num_processes,
          model_config_keys=model_config_keys,
          data_config_keys=data_config_keys,
          optim_config_keys=optim_config_keys,
          loss_config_keys=loss_config_keys,
          **merged_config,
      )
  
imports: from bigdl.chronos.forecaster.abstract import Forecaster
  from bigdl.chronos.forecaster.utils import *
  from bigdl.chronos.metric.forecast_metrics import Evaluator
  from typing import Optional
  import numpy
  import warnings
  import os
  from tempfile import TemporaryDirectory
  import torch
  from torch.utils.data import TensorDataset, DataLoader
  from .utils_hpo import GenericLightningModule, _format_metric_str, _config_has_search_space
  from bigdl.nano.utils.common import invalidOperationError, invalidInputError
  from bigdl.chronos.data.tsdataset import TSDataset
  from bigdl.chronos.pytorch.context_manager import DummyForecasterContextManager, ForecasterContextManager
  from bigdl.chronos.pytorch.utils import _pytorch_fashion_inference
label_desc: Use image node_id 2 for calling the BasePytorchForecaster obj's underlying member method code with example usage: obj._build_automodel(data, validation_data, batch_size, epochs) and returns: GenericLightningModule