class_docstr: FISM is an item-based model for generating top-N recommendations that learns the
  item-item similarity matrix as the product of two low dimensional latent factor matrices.
  These matrices are learned using a structural equation modeling approach, where in the
  value being estimated is not used for its own estimation.
class_docstr_tok: ["FISM","is","an","item-based","model","for","generating","top-N","recommendations","that","learns","the","item-item","similarity","matrix","as","the","product","of","two","low","dimensional","latent","factor","matrices",".","These","matrices","are","learned","using","a","structural","equation","modeling","approach",",","where","in","the","value","being","estimated","is","not","used","for","its","own","estimation","."]
docstr: forward the model by interaction
docstr_tok: ["forward","the","model","by","interaction"]
code: def inter_forward(self, user, item):
      """forward the model by interaction"""
      user_inter = self.history_item_matrix[user]
      item_num = self.history_lens[user].unsqueeze(1)
      batch_mask_mat = self.mask_mat[user]
      user_history = self.item_src_embedding(
          user_inter
      )  # batch_size x max_len x embedding_size
      target = self.item_dst_embedding(
          item
      )  # batch_size x embedding_size
      user_bias = self.user_bias[user]  # batch_size x 1
      item_bias = self.item_bias[item]
      similarity = torch.bmm(user_history, target.unsqueeze(2)).squeeze(
          2
      )  # batch_size x max_len
      similarity = batch_mask_mat * similarity
      coeff = torch.pow(item_num.squeeze(1), -self.alpha)
      scores = torch.sigmoid(
          coeff.float() * torch.sum(similarity, dim=1)
          + user_bias
          + item_bias
      )
      return scores
  
file_path: RecBole/recbole/model/general_recommender/fism.py
imports: import torch
  import torch.nn
  from torch.nn.init import normal_
  from recbole.model.abstract_recommender import GeneralRecommender
  from recbole.utils import InputType
label_desc: Use image node_id 5 for calling the FISM obj's underlying member method code with example usage: obj.inter_forward(user, item) and returns: scores