class_docstr: Base class for sequential models
class_docstr_tok: ["Base","class","for","sequential","models"]
docstr: Initializing the model. Create common logics which are needed by all sequential models, such as loss function,
  parameter set.
  
  Args:
      hparams (HParams): A `HParams` object, hold the entire set of hyperparameters.
      iterator_creator (object): An iterator to load the data.
      graph (object): An optional graph.
      seed (int): Random seed.
docstr_tok: ["Initializing","the","model",".","Create","common","logics","which","are","needed","by","all","sequential","models",",","such","as","loss","function",",","parameter","set",".","Args",":","hparams","(","HParams",")",":","A","`","HParams","`","object",",","hold","the","entire","set","of","hyperparameters",".","iterator_creator","(","object",")",":","An","iterator","to","load","the","data",".","graph","(","object",")",":","An","optional","graph",".","seed","(","int",")",":","Random","seed","."]
code: def __init__(self, hparams, iterator_creator, graph=None, seed=None):
      """Initializing the model. Create common logics which are needed by all sequential models, such as loss function,
      parameter set.
  
      Args:
          hparams (HParams): A `HParams` object, hold the entire set of hyperparameters.
          iterator_creator (object): An iterator to load the data.
          graph (object): An optional graph.
          seed (int): Random seed.
      """
      self.hparams = hparams
  
      self.need_sample = hparams.need_sample
      self.train_num_ngs = hparams.train_num_ngs
      if self.train_num_ngs is None:
          raise ValueError(
              "Please confirm the number of negative samples for each positive instance."
          )
      self.min_seq_length = (
          hparams.min_seq_length
          if "min_seq_length" in hparams.values()
          else 1
      )
      self.hidden_size = (
          hparams.hidden_size
          if "hidden_size" in hparams.values()
          else None
      )
      self.graph = tf.Graph() if not graph else graph
  
      with self.graph.as_default():
          self.sequence_length = tf.compat.v1.placeholder(
              tf.int32, [None], name="sequence_length"
          )
  
      super().__init__(
          hparams, iterator_creator, graph=self.graph, seed=seed
      )
  
file_path: recommenders/recommenders/models/deeprec/models/sequential/sequential_base_model.py
imports: import os
  import abc
  import numpy
  import tensorflow
  from recommenders.models.deeprec.models.base_model import BaseModel
  from recommenders.models.deeprec.deeprec_utils import cal_metric, load_dict
label_desc: Use image node_id 1 to create a new SequentialBaseModel object from inherited base classes: BaseModel with example: obj = SequentialBaseModel(hparams, iterator_creator, graph, seed)