class_docstr: NGCF is a model that incorporate GNN for recommendation.
  We implement the model following the original author with a pairwise training mode.
class_docstr_tok: ["NGCF","is","a","model","that","incorporate","GNN","for","recommendation",".","We","implement","the","model","following","the","original","author","with","a","pairwise","training","mode","."]
code: def __init__(self, config, dataset):
      super(NGCF, self).__init__(config, dataset)
  
      # load dataset info
      self.interaction_matrix = dataset.inter_matrix(form="coo").astype(
          np.float32
      )
  
      # load parameters info
      self.embedding_size = config["embedding_size"]
      self.hidden_size_list = config["hidden_size_list"]
      self.hidden_size_list = [
          self.embedding_size
      ] + self.hidden_size_list
      self.node_dropout = config["node_dropout"]
      self.message_dropout = config["message_dropout"]
      self.reg_weight = config["reg_weight"]
  
      # define layers and loss
      self.sparse_dropout = SparseDropout(self.node_dropout)
      self.user_embedding = nn.Embedding(
          self.n_users, self.embedding_size
      )
      self.item_embedding = nn.Embedding(
          self.n_items, self.embedding_size
      )
      self.GNNlayers = torch.nn.ModuleList()
      for idx, (input_size, output_size) in enumerate(
          zip(self.hidden_size_list[:-1], self.hidden_size_list[1:])
      ):
          self.GNNlayers.append(BiGNNLayer(input_size, output_size))
      self.mf_loss = BPRLoss()
      self.reg_loss = EmbLoss()
  
      # storage variables for full sort evaluation acceleration
      self.restore_user_e = None
      self.restore_item_e = None
  
      # generate intermediate data
      self.norm_adj_matrix = self.get_norm_adj_mat().to(self.device)
      self.eye_matrix = self.get_eye_mat().to(self.device)
  
      # parameters initialization
      self.apply(xavier_normal_initialization)
      self.other_parameter_name = ["restore_user_e", "restore_item_e"]
  
file_path: RecBole/recbole/model/general_recommender/ngcf.py
imports: import numpy
  import scipy.sparse
  import torch
  import torch.nn
  import torch.nn.functional
  from recbole.model.abstract_recommender import GeneralRecommender
  from recbole.model.init import xavier_normal_initialization
  from recbole.model.layers import BiGNNLayer, SparseDropout
  from recbole.model.loss import BPRLoss, EmbLoss
  from recbole.utils import InputType
label_desc: Use image node_id 1 to create a new NGCF object from inherited base classes: GeneralRecommender with example: obj = NGCF(config, dataset)