class_docstr: IGMTF 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 train_epoch(
      self, x_train, y_train, train_hidden, train_hidden_day
  ):
      x_train_values = x_train.values
      y_train_values = np.squeeze(y_train.values)
  
      self.igmtf_model.train()
  
      daily_index, daily_count = self.get_daily_inter(
          x_train, shuffle=True
      )
  
      for idx, count in zip(daily_index, daily_count):
          batch = slice(idx, idx + count)
          feature = (
              torch.from_numpy(x_train_values[batch])
              .float()
              .to(self.device)
          )
          label = (
              torch.from_numpy(y_train_values[batch])
              .float()
              .to(self.device)
          )
          pred = self.igmtf_model(
              feature,
              train_hidden=train_hidden,
              train_hidden_day=train_hidden_day,
          )
          loss = self.loss_fn(pred, label)
  
          self.train_optimizer.zero_grad()
          loss.backward()
          torch.nn.utils.clip_grad_value_(
              self.igmtf_model.parameters(), 3.0
          )
          self.train_optimizer.step()
  
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
  from ...contrib.model.pytorch_lstm import LSTMModel
  from ...contrib.model.pytorch_gru import GRUModel
label_desc: Use image node_id 8 for calling the IGMTF obj's underlying member method code with example usage: obj.train_epoch(x_train, y_train, train_hidden, train_hidden_day) without return types