class_docstr: SFM Model
  
  Parameters
  ----------
  input_dim : int
      input dimension
  output_dim : int
      output dimension
  lr : float
      learning rate
  optimizer : str
      optimizer name
  GPU : int
      the GPU ID used for training
code: def __init__(
      self,
      d_feat=6,
      hidden_size=64,
      output_dim=1,
      freq_dim=10,
      dropout_W=0.0,
      dropout_U=0.0,
      n_epochs=200,
      lr=0.001,
      metric="",
      batch_size=2000,
      early_stop=20,
      eval_steps=5,
      loss="mse",
      optimizer="gd",
      GPU=0,
      seed=None,
      **kwargs,
  ):
      # Set logger.
      self.logger = get_module_logger("SFM")
      self.logger.info("SFM pytorch version...")
  
      # set hyper-parameters.
      self.d_feat = d_feat
      self.hidden_size = hidden_size
      self.output_dim = output_dim
      self.freq_dim = freq_dim
      self.dropout_W = dropout_W
      self.dropout_U = dropout_U
      self.n_epochs = n_epochs
      self.lr = lr
      self.metric = metric
      self.batch_size = batch_size
      self.early_stop = early_stop
      self.eval_steps = eval_steps
      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(
          "SFM parameters setting:"
          "\nd_feat : {}"
          "\nhidden_size : {}"
          "\noutput_size : {}"
          "\nfrequency_dimension : {}"
          "\ndropout_W: {}"
          "\ndropout_U: {}"
          "\nn_epochs : {}"
          "\nlr : {}"
          "\nmetric : {}"
          "\nbatch_size : {}"
          "\nearly_stop : {}"
          "\neval_steps : {}"
          "\noptimizer : {}"
          "\nloss_type : {}"
          "\ndevice : {}"
          "\nuse_GPU : {}"
          "\nseed : {}".format(
              d_feat,
              hidden_size,
              output_dim,
              freq_dim,
              dropout_W,
              dropout_U,
              n_epochs,
              lr,
              metric,
              batch_size,
              early_stop,
              eval_steps,
              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.sfm_model = SFM_Model(
          d_feat=self.d_feat,
          output_dim=self.output_dim,
          hidden_size=self.hidden_size,
          freq_dim=self.freq_dim,
          dropout_W=self.dropout_W,
          dropout_U=self.dropout_U,
          device=self.device,
      )
      self.logger.info("model:\n{:}".format(self.sfm_model))
      self.logger.info(
          "model size: {:.4f} MB".format(
              count_parameters(self.sfm_model)
          )
      )
  
      if optimizer.lower() == "adam":
          self.train_optimizer = optim.Adam(
              self.sfm_model.parameters(), lr=self.lr
          )
      elif optimizer.lower() == "gd":
          self.train_optimizer = optim.SGD(
              self.sfm_model.parameters(), lr=self.lr
          )
      else:
          raise NotImplementedError(
              "optimizer {} is not supported!".format(optimizer)
          )
  
      self.fitted = False
      self.sfm_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.nn.init
  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 SFM object from inherited base classes: Model with example: obj = SFM(d_feat, hidden_size, output_dim, freq_dim, dropout_W, dropout_U, n_epochs, lr, metric, batch_size, early_stop, eval_steps, loss, optimizer, GPU, seed)