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)}>
docstr: Get different types of ffm layer's input.
docstr_tok: ["Get","different","types","of","ffm","layer","'s","input","."]
code: def get_ffm_input(self, interaction):
      r"""Get different types of ffm layer's input."""
      token_ffm_input = []
      if self.token_field_names is not None:
          for tn in self.token_field_names:
              token_ffm_input.append(
                  torch.unsqueeze(interaction[tn], 1)
              )
          if len(token_ffm_input) > 0:
              token_ffm_input = torch.cat(
                  token_ffm_input, dim=1
              )  # [batch_size, num_token_features]
      float_ffm_input = []
      if self.float_field_names is not None:
          for fn in self.float_field_names:
              float_ffm_input.append(
                  torch.unsqueeze(interaction[fn], 1)
              )
          if len(float_ffm_input) > 0:
              float_ffm_input = torch.cat(
                  float_ffm_input, dim=1
              )  # [batch_size, num_float_features]
      token_seq_ffm_input = []
      if self.token_seq_field_names is not None:
          for tsn in self.token_seq_field_names:
              token_seq_ffm_input.append(interaction[tsn])  # a list
      float_seq_ffm_input = []
      if self.float_seq_field_names is not None:
          for tsn in self.float_seq_field_names:
              float_seq_ffm_input.append(interaction[tsn])  # a list
  
      return (
          token_ffm_input,
          float_ffm_input,
          token_seq_ffm_input,
          float_seq_ffm_input,
      )
  
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 4 for calling the FFM obj's underlying member method code with example usage: obj.get_ffm_input(interaction) and returns: token_ffm_input,  float_ffm_input,  token_seq_ffm_input,  float_seq_ffm_input