class_docstr: NFM replace the fm part as a mlp to model the feature interaction.
class_docstr_tok: ["NFM","replace","the","fm","part","as","a","mlp","to","model","the","feature","interaction","."]
code: def __init__(self, config, dataset):
      super(NFM, self).__init__(config, dataset)
  
      # load parameters info
      self.mlp_hidden_size = config["mlp_hidden_size"]
      self.dropout_prob = config["dropout_prob"]
  
      # define layers and loss
      size_list = [self.embedding_size] + self.mlp_hidden_size
      self.fm = BaseFactorizationMachine(reduce_sum=False)
      self.bn = nn.BatchNorm1d(num_features=self.embedding_size)
      self.mlp_layers = MLPLayers(
          size_list, self.dropout_prob, activation="sigmoid", bn=True
      )
      self.predict_layer = nn.Linear(
          self.mlp_hidden_size[-1], 1, bias=False
      )
      self.sigmoid = nn.Sigmoid()
      self.loss = nn.BCEWithLogitsLoss()
  
      # parameters initialization
      self.apply(self._init_weights)
  
file_path: RecBole/recbole/model/context_aware_recommender/nfm.py
imports: import torch.nn
  from torch.nn.init import xavier_normal_, constant_
  from recbole.model.abstract_recommender import ContextRecommender
  from recbole.model.layers import BaseFactorizationMachine, MLPLayers
label_desc: Use image node_id 1 to create a new NFM object from inherited base classes: ContextRecommender with example: obj = NFM(config, dataset)