class_docstr: KRNN 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 : str
      the GPU ID(s) used for training
code: def __init__(
      self,
      fea_dim=6,
      cnn_dim=64,
      cnn_kernel_size=3,
      rnn_dim=64,
      rnn_dups=3,
      rnn_layers=2,
      dropout=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("KRNN")
      self.logger.info("KRNN pytorch version...")
  
      # set hyper-parameters.
      self.fea_dim = fea_dim
      self.cnn_dim = cnn_dim
      self.cnn_kernel_size = cnn_kernel_size
      self.rnn_dim = rnn_dim
      self.rnn_dups = rnn_dups
      self.rnn_layers = rnn_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(
          "KRNN parameters setting:"
          "\nfea_dim : {}"
          "\ncnn_dim : {}"
          "\ncnn_kernel_size : {}"
          "\nrnn_dim : {}"
          "\nrnn_dups : {}"
          "\nrnn_layers : {}"
          "\ndropout : {}"
          "\nn_epochs : {}"
          "\nlr : {}"
          "\nmetric : {}"
          "\nbatch_size: {}"
          "\nearly_stop : {}"
          "\noptimizer : {}"
          "\nloss_type : {}"
          "\nvisible_GPU : {}"
          "\nuse_GPU : {}"
          "\nseed : {}".format(
              fea_dim,
              cnn_dim,
              cnn_kernel_size,
              rnn_dim,
              rnn_dups,
              rnn_layers,
              dropout,
              n_epochs,
              lr,
              metric,
              batch_size,
              early_stop,
              optimizer.lower(),
              loss,
              GPU,
              self.use_gpu,
              seed,
          )
      )
  
      if self.seed is not None:
          np.random.seed(self.seed)
          torch.manual_seed(self.seed)
  
      self.krnn_model = KRNNModel(
          fea_dim=self.fea_dim,
          cnn_dim=self.cnn_dim,
          cnn_kernel_size=self.cnn_kernel_size,
          rnn_dim=self.rnn_dim,
          rnn_dups=self.rnn_dups,
          rnn_layers=self.rnn_layers,
          dropout=self.dropout,
          device=self.device,
      )
      if optimizer.lower() == "adam":
          self.train_optimizer = optim.Adam(
              self.krnn_model.parameters(), lr=self.lr
          )
      elif optimizer.lower() == "gd":
          self.train_optimizer = optim.SGD(
              self.krnn_model.parameters(), lr=self.lr
          )
      else:
          raise NotImplementedError(
              "optimizer {} is not supported!".format(optimizer)
          )
  
      self.fitted = False
      self.krnn_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 ...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 KRNN object from inherited base classes: Model with example: obj = KRNN(fea_dim, cnn_dim, cnn_kernel_size, rnn_dim, rnn_dups, rnn_layers, dropout, n_epochs, lr, metric, batch_size, early_stop, loss, optimizer, GPU, seed)