class_docstr: Neural Collaborative Filtering (NCF) implementation
  
  :Citation:
  
      He, Xiangnan, Lizi Liao, Hanwang Zhang, Liqiang Nie, Xia Hu, and Tat-Seng Chua. "Neural collaborative filtering."
      In Proceedings of the 26th International Conference on World Wide Web, pp. 173-182. International World Wide Web
      Conferences Steering Committee, 2017. Link: https://www.comp.nus.edu.sg/~xiangnan/papers/ncf.pdf
class_docstr_tok: ["Neural","Collaborative","Filtering","(","NCF",")","implementation",":","Citation",":","He",",","Xiangnan",",","Lizi","Liao",",","Hanwang","Zhang",",","Liqiang","Nie",",","Xia","Hu",",","and","Tat-Seng","Chua",".","``","Neural","collaborative","filtering",".","''","In","Proceedings","of","the","26th","International","Conference","on","World","Wide","Web",",","pp",".","173-182.","International","World","Wide","Web","Conferences","Steering","Committee",",","2017",".","Link",":","https",":","\/\/www.comp.nus.edu.sg\/~xiangnan\/papers\/ncf.pdf"]
docstr: Load model parameters for further use.
  
  GMF model --> load parameters in `gmf_dir`
  
  MLP model --> load parameters in `mlp_dir`
  
  NeuMF model --> load parameters in `neumf_dir` or in `gmf_dir` and `mlp_dir`
  
  Args:
      gmf_dir (str): Directory name for GMF model.
      mlp_dir (str): Directory name for MLP model.
      neumf_dir (str): Directory name for neumf model.
      alpha (float): the concatenation hyper-parameter for gmf and mlp output layer.
  
  Returns:
      object: Load parameters in this model.
docstr_tok: ["Load","model","parameters","for","further","use",".","GMF","model","--",">","load","parameters","in","`","gmf_dir","`","MLP","model","--",">","load","parameters","in","`","mlp_dir","`","NeuMF","model","--",">","load","parameters","in","`","neumf_dir","`","or","in","`","gmf_dir","`","and","`","mlp_dir","`","Args",":","gmf_dir","(","str",")",":","Directory","name","for","GMF","model",".","mlp_dir","(","str",")",":","Directory","name","for","MLP","model",".","neumf_dir","(","str",")",":","Directory","name","for","neumf","model",".","alpha","(","float",")",":","the","concatenation","hyper-parameter","for","gmf","and","mlp","output","layer",".","Returns",":","object",":","Load","parameters","in","this","model","."]
code: def load(self, gmf_dir=None, mlp_dir=None, neumf_dir=None, alpha=0.5):
      """Load model parameters for further use.
  
      GMF model --> load parameters in `gmf_dir`
  
      MLP model --> load parameters in `mlp_dir`
  
      NeuMF model --> load parameters in `neumf_dir` or in `gmf_dir` and `mlp_dir`
  
      Args:
          gmf_dir (str): Directory name for GMF model.
          mlp_dir (str): Directory name for MLP model.
          neumf_dir (str): Directory name for neumf model.
          alpha (float): the concatenation hyper-parameter for gmf and mlp output layer.
  
      Returns:
          object: Load parameters in this model.
      """
  
      # load pre-trained model
      if self.model_type == "gmf" and gmf_dir is not None:
          saver = tf.compat.v1.train.Saver()
          saver.restore(
              self.sess, os.path.join(gmf_dir, MODEL_CHECKPOINT)
          )
  
      elif self.model_type == "mlp" and mlp_dir is not None:
          saver = tf.compat.v1.train.Saver()
          saver.restore(
              self.sess, os.path.join(mlp_dir, MODEL_CHECKPOINT)
          )
  
      elif self.model_type == "neumf" and neumf_dir is not None:
          saver = tf.compat.v1.train.Saver()
          saver.restore(
              self.sess, os.path.join(neumf_dir, MODEL_CHECKPOINT)
          )
  
      elif (
          self.model_type == "neumf"
          and gmf_dir is not None
          and mlp_dir is not None
      ):
          # load neumf using gmf and mlp
          self._load_neumf(gmf_dir, mlp_dir, alpha)
  
      else:
          raise NotImplementedError
  
file_path: recommenders/recommenders/models/ncf/ncf_singlenode.py
imports: import os
  import numpy
  import tensorflow
  import tf_slim
  from time import time
  import logging
label_desc: Use image node_id 4 for calling the NCF obj's underlying member method code with example usage: obj.load(gmf_dir, mlp_dir, neumf_dir, alpha) without return types