class_docstr: ALSTM Model
  
  Parameters
  ----------
  d_feat : int
      input dimension for each time step
  metric: str
      the evaluation metric used in early stop
  optimizer : str
      optimizer name
  GPU : int
      the GPU ID used for training
class_docstr_tok: ["ALSTM","Model","Parameters","--","--","--","--","--","d_feat",":","int","input","dimension","for","each","time","step","metric",":","str","the","evaluation","metric","used","in","early","stop","optimizer",":","str","optimizer","name","GPU",":","int","the","GPU","ID","used","for","training"]
code: def __init__(
      self,
      d_feat=6,
      hidden_size=64,
      num_layers=2,
      dropout=0.0,
      n_epochs=200,
      lr=0.001,
      metric="",
      batch_size=2000,
      early_stop=20,
      loss="mse",
      optimizer="adam",
      GPU=0,
      seed=None,
      **kwargs,
  ):
      # Set logger.
      self.logger = get_module_logger("ALSTM")
      self.logger.info("ALSTM pytorch version...")
  
      # set hyper-parameters.
      self.d_feat = d_feat
      self.hidden_size = hidden_size
      self.num_layers = num_layers
      self.dropout = dropout
      self.n_epochs = n_epochs
      self.lr = lr
      self.metric = metric
      self.batch_size = batch_size
      self.early_stop = early_stop
      self.optimizer = optimizer.lower()
      self.loss = loss
      self.device = torch.device(
          "cuda:%d" % (GPU)
          if torch.cuda.is_available() and GPU >= 0
          else "cpu"
      )
      self.seed = seed
  
      self.logger.info(
          "ALSTM parameters setting:"
          "\nd_feat : {}"
          "\nhidden_size : {}"
          "\nnum_layers : {}"
          "\ndropout : {}"
          "\nn_epochs : {}"
          "\nlr : {}"
          "\nmetric : {}"
          "\nbatch_size : {}"
          "\nearly_stop : {}"
          "\noptimizer : {}"
          "\nloss_type : {}"
          "\ndevice : {}"
          "\nuse_GPU : {}"
          "\nseed : {}".format(
              d_feat,
              hidden_size,
              num_layers,
              dropout,
              n_epochs,
              lr,
              metric,
              batch_size,
              early_stop,
              optimizer.lower(),
              loss,
              self.device,
              self.use_gpu,
              seed,
          )
      )
  
      if self.seed is not None:
          np.random.seed(self.seed)
          torch.manual_seed(self.seed)
  
      self.ALSTM_model = ALSTMModel(
          d_feat=self.d_feat,
          hidden_size=self.hidden_size,
          num_layers=self.num_layers,
          dropout=self.dropout,
      )
      self.logger.info("model:\n{:}".format(self.ALSTM_model))
      self.logger.info(
          "model size: {:.4f} MB".format(
              count_parameters(self.ALSTM_model)
          )
      )
  
      if optimizer.lower() == "adam":
          self.train_optimizer = optim.Adam(
              self.ALSTM_model.parameters(), lr=self.lr
          )
      elif optimizer.lower() == "gd":
          self.train_optimizer = optim.SGD(
              self.ALSTM_model.parameters(), lr=self.lr
          )
      else:
          raise NotImplementedError(
              "optimizer {} is not supported!".format(optimizer)
          )
  
      self.fitted = False
      self.ALSTM_model.to(self.device)
  
imports: from __future__ import division
  from __future__ import print_function
  import numpy
  import pandas
  from typing import Text, Union
  import copy
  from ...utils import get_or_create_path
  from ...log import get_module_logger
  import torch
  import torch.nn
  import torch.optim
  from .pytorch_utils import count_parameters
  from ...model.base import Model
  from ...data.dataset import DatasetH
  from ...data.dataset.handler import DataHandlerLP
label_desc: Use image node_id 1 to create a new ALSTM object from inherited base classes: Model with example: obj = ALSTM(d_feat, hidden_size, num_layers, dropout, n_epochs, lr, metric, batch_size, early_stop, loss, optimizer, GPU, seed)