class_docstr: Factorization Machine considers the second-order interaction with features to predict the final score.
class_docstr_tok: ["Factorization","Machine","considers","the","second-order","interaction","with","features","to","predict","the","final","score","."]
code: def __init__(self, config, dataset):
      super(FM, self).__init__(config, dataset)
  
      # define layers and loss
      self.fm = BaseFactorizationMachine(reduce_sum=True)
      self.sigmoid = nn.Sigmoid()
      self.loss = nn.BCEWithLogitsLoss()
  
      # parameters initialization
      self.apply(self._init_weights)
  
file_path: RecBole/recbole/model/context_aware_recommender/fm.py
imports: import torch.nn
  from torch.nn.init import xavier_normal_
  from recbole.model.abstract_recommender import ContextRecommender
  from recbole.model.layers import BaseFactorizationMachine
label_desc: Use image node_id 1 to create a new FM object from inherited base classes: ContextRecommender with example: obj = FM(config, dataset)