class_docstr: NeuMF is an neural network enhanced matrix factorization model.
  It replace the dot product to mlp for a more precise user-item interaction.
  
  Note:
  
      Our implementation only contains a rough pretraining function.
class_docstr_tok: ["NeuMF","is","an","neural","network","enhanced","matrix","factorization","model",".","It","replace","the","dot","product","to","mlp","for","a","more","precise","user-item","interaction",".","Note",":","Our","implementation","only","contains","a","rough","pretraining","function","."]
code: def __init__(self, config, dataset):
      super(NeuMF, self).__init__(config, dataset)
  
      # load dataset info
      self.LABEL = config["LABEL_FIELD"]
  
      # load parameters info
      self.mf_embedding_size = config["mf_embedding_size"]
      self.mlp_embedding_size = config["mlp_embedding_size"]
      self.mlp_hidden_size = config["mlp_hidden_size"]
      self.dropout_prob = config["dropout_prob"]
      self.mf_train = config["mf_train"]
      self.mlp_train = config["mlp_train"]
      self.use_pretrain = config["use_pretrain"]
      self.mf_pretrain_path = config["mf_pretrain_path"]
      self.mlp_pretrain_path = config["mlp_pretrain_path"]
  
      # define layers and loss
      self.user_mf_embedding = nn.Embedding(
          self.n_users, self.mf_embedding_size
      )
      self.item_mf_embedding = nn.Embedding(
          self.n_items, self.mf_embedding_size
      )
      self.user_mlp_embedding = nn.Embedding(
          self.n_users, self.mlp_embedding_size
      )
      self.item_mlp_embedding = nn.Embedding(
          self.n_items, self.mlp_embedding_size
      )
      self.mlp_layers = MLPLayers(
          [2 * self.mlp_embedding_size] + self.mlp_hidden_size,
          self.dropout_prob,
      )
      self.mlp_layers.logger = None  # remove logger to use torch.save()
      if self.mf_train and self.mlp_train:
          self.predict_layer = nn.Linear(
              self.mf_embedding_size + self.mlp_hidden_size[-1], 1
          )
      elif self.mf_train:
          self.predict_layer = nn.Linear(self.mf_embedding_size, 1)
      elif self.mlp_train:
          self.predict_layer = nn.Linear(self.mlp_hidden_size[-1], 1)
      self.sigmoid = nn.Sigmoid()
      self.loss = nn.BCEWithLogitsLoss()
  
      # parameters initialization
      if self.use_pretrain:
          self.load_pretrain()
      else:
          self.apply(self._init_weights)
  
file_path: RecBole/recbole/model/general_recommender/neumf.py
imports: import torch
  import torch.nn
  from torch.nn.init import normal_
  from recbole.model.abstract_recommender import GeneralRecommender
  from recbole.model.layers import MLPLayers
  from recbole.utils import InputType
label_desc: Use image node_id 1 to create a new NeuMF object from inherited base classes: GeneralRecommender with example: obj = NeuMF(config, dataset)