class_docstr: Basic class of models
  
  Attributes:
      hparams (HParams): A HParams object, holds the entire set of hyperparameters.
      train_iterator (object): An iterator to load the data in training steps.
      test_iterator (object): An iterator to load the data in testing steps.
      graph (object): An optional graph.
      seed (int): Random seed.
class_docstr_tok: ["Basic","class","of","models","Attributes",":","hparams","(","HParams",")",":","A","HParams","object",",","holds","the","entire","set","of","hyperparameters",".","train_iterator","(","object",")",":","An","iterator","to","load","the","data","in","training","steps",".","test_iterator","(","object",")",":","An","iterator","to","load","the","data","in","testing","steps",".","graph","(","object",")",":","An","optional","graph",".","seed","(","int",")",":","Random","seed","."]
docstr: Get the optimizer according to configuration. Usually we will use Adam.
  Returns:
      object: An optimizer.
docstr_tok: ["Get","the","optimizer","according","to","configuration",".","Usually","we","will","use","Adam",".","Returns",":","object",":","An","optimizer","."]
code: def _get_opt(self):
      """Get the optimizer according to configuration. Usually we will use Adam.
      Returns:
          object: An optimizer.
      """
      lr = self.hparams.learning_rate
      optimizer = self.hparams.optimizer
  
      if optimizer == "adam":
          train_opt = keras.optimizers.Adam(lr=lr)
  
      return train_opt
  
imports: import abc
  import time
  import numpy
  from tqdm import tqdm
  import tensorflow
  from tensorflow.compat.v1 import keras
  from recommenders.models.deeprec.deeprec_utils import cal_metric
label_desc: Use image node_id 6 for calling the BaseModel obj's underlying member method code with example usage: obj._get_opt() and returns: train_opt