class_docstr: DeepFM is a DNN enhanced FM which both use a DNN and a FM to calculate feature interaction.
  Also DeepFM can be seen as a combination of FNN and FM.
class_docstr_tok: ["DeepFM","is","a","DNN","enhanced","FM","which","both","use","a","DNN","and","a","FM","to","calculate","feature","interaction",".","Also","DeepFM","can","be","seen","as","a","combination","of","FNN","and","FM","."]
code: def forward(self, interaction):
      deepfm_all_embeddings = self.concat_embed_input_fields(
          interaction
      )  # [batch_size, num_field, embed_dim]
      batch_size = deepfm_all_embeddings.shape[0]
      y_fm = self.first_order_linear(interaction) + self.fm(
          deepfm_all_embeddings
      )
  
      y_deep = self.deep_predict_layer(
          self.mlp_layers(deepfm_all_embeddings.view(batch_size, -1))
      )
      y = y_fm + y_deep
      return y.squeeze(-1)
  
file_path: RecBole/recbole/model/context_aware_recommender/deepfm.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 3 for calling the DeepFM obj's underlying member method code with example usage: obj.forward(interaction) and returns: y