class_docstr: FFM is a context-based recommendation model. It aims to model the different feature interactions
  between different fields. Each feature has several latent vectors :math:`v_{i,F(j)}`,
  which depend on the field of other features, and one of them is used to do the inner product.
  
  The model defines as follows:
  
  .. math::
     y = w_0 + \sum_{i=1}^{m}x_{i}w_{i} + \sum_{i=1}^{m}\sum_{j=i+1}^{m}x_{i}x_{j}<v_{i,F(j)}, v_{j,F(i)}>
code: def forward(self, interaction):
      ffm_input = self.get_ffm_input(interaction)
      ffm_output = torch.sum(
          torch.sum(self.ffm(ffm_input), dim=1), dim=1, keepdim=True
      )
      output = self.first_order_linear(interaction) + ffm_output
  
      return output.squeeze(-1)
  
imports: import numpy
  import torch
  import torch.nn
  from torch.nn.init import xavier_normal_, constant_
  from recbole.model.abstract_recommender import ContextRecommender
label_desc: Use image node_id 5 for calling the FFM obj's underlying member method code with example usage: obj.forward(interaction) and returns: output