class_docstr: LightGCN model
  
  :Citation:
  
      He, Xiangnan, Kuan Deng, Xiang Wang, Yan Li, Yongdong Zhang, and Meng Wang.
      "LightGCN: Simplifying and Powering Graph Convolution Network for Recommendation." arXiv
      preprint arXiv:2002.02126, 2020.
docstr: Initializing the model. Create parameters, placeholders, embeddings and loss function.
  
  Args:
      hparams (HParams): A HParams object, hold the entire set of hyperparameters.
      data (object): A recommenders.models.deeprec.DataModel.ImplicitCF object, load and process data.
      seed (int): Seed.
docstr_tok: ["Initializing","the","model",".","Create","parameters",",","placeholders",",","embeddings","and","loss","function",".","Args",":","hparams","(","HParams",")",":","A","HParams","object",",","hold","the","entire","set","of","hyperparameters",".","data","(","object",")",":","A","recommenders.models.deeprec.DataModel.ImplicitCF","object",",","load","and","process","data",".","seed","(","int",")",":","Seed","."]
code: def __init__(self, hparams, data, seed=None):
      """Initializing the model. Create parameters, placeholders, embeddings and loss function.
  
      Args:
          hparams (HParams): A HParams object, hold the entire set of hyperparameters.
          data (object): A recommenders.models.deeprec.DataModel.ImplicitCF object, load and process data.
          seed (int): Seed.
  
      """
  
      tf.compat.v1.set_random_seed(seed)
      np.random.seed(seed)
  
      self.data = data
      self.epochs = hparams.epochs
      self.lr = hparams.learning_rate
      self.emb_dim = hparams.embed_size
      self.batch_size = hparams.batch_size
      self.n_layers = hparams.n_layers
      self.decay = hparams.decay
      self.eval_epoch = hparams.eval_epoch
      self.top_k = hparams.top_k
      self.save_model = hparams.save_model
      self.save_epoch = hparams.save_epoch
      self.metrics = hparams.metrics
      self.model_dir = hparams.MODEL_DIR
  
      metric_options = ["map", "ndcg", "precision", "recall"]
      for metric in self.metrics:
          if metric not in metric_options:
              raise ValueError(
                  "Wrong metric(s), please select one of this list: {}".format(
                      metric_options
                  )
              )
  
      self.norm_adj = data.get_norm_adj_mat()
  
      self.n_users = data.n_users
      self.n_items = data.n_items
  
      self.users = tf.compat.v1.placeholder(tf.int32, shape=(None,))
      self.pos_items = tf.compat.v1.placeholder(tf.int32, shape=(None,))
      self.neg_items = tf.compat.v1.placeholder(tf.int32, shape=(None,))
  
      self.weights = self._init_weights()
      (
          self.ua_embeddings,
          self.ia_embeddings,
      ) = self._create_lightgcn_embed()
  
      self.u_g_embeddings = tf.nn.embedding_lookup(
          params=self.ua_embeddings, ids=self.users
      )
      self.pos_i_g_embeddings = tf.nn.embedding_lookup(
          params=self.ia_embeddings, ids=self.pos_items
      )
      self.neg_i_g_embeddings = tf.nn.embedding_lookup(
          params=self.ia_embeddings, ids=self.neg_items
      )
      self.u_g_embeddings_pre = tf.nn.embedding_lookup(
          params=self.weights["user_embedding"], ids=self.users
      )
      self.pos_i_g_embeddings_pre = tf.nn.embedding_lookup(
          params=self.weights["item_embedding"], ids=self.pos_items
      )
      self.neg_i_g_embeddings_pre = tf.nn.embedding_lookup(
          params=self.weights["item_embedding"], ids=self.neg_items
      )
  
      self.batch_ratings = tf.matmul(
          self.u_g_embeddings,
          self.pos_i_g_embeddings,
          transpose_a=False,
          transpose_b=True,
      )
  
      self.mf_loss, self.emb_loss = self._create_bpr_loss(
          self.u_g_embeddings,
          self.pos_i_g_embeddings,
          self.neg_i_g_embeddings,
      )
      self.loss = self.mf_loss + self.emb_loss
  
      self.opt = tf.compat.v1.train.AdamOptimizer(
          learning_rate=self.lr
      ).minimize(self.loss)
      self.saver = tf.compat.v1.train.Saver(max_to_keep=1)
  
      gpu_options = tf.compat.v1.GPUOptions(allow_growth=True)
      self.sess = tf.compat.v1.Session(
          config=tf.compat.v1.ConfigProto(gpu_options=gpu_options)
      )
      self.sess.run(tf.compat.v1.global_variables_initializer())
  
imports: import tensorflow
  import time
  import os
  import sys
  import numpy
  import pandas
  from recommenders.evaluation.python_evaluation import map_at_k, ndcg_at_k, precision_at_k, recall_at_k
  from recommenders.utils.python_utils import get_top_k_scored_items
label_desc: Use image node_id 1 to create a new LightGCN object from inherited base classes: object with example: obj = LightGCN(hparams, data, seed)