class_docstr: FiGNN is a CTR prediction model based on GGNN,
  which can model sophisticated interactions among feature fields on the graph-structured features.
class_docstr_tok: ["FiGNN","is","a","CTR","prediction","model","based","on","GGNN",",","which","can","model","sophisticated","interactions","among","feature","fields","on","the","graph-structured","features","."]
code: def fignn_layer(self, in_feature):
      emb_feature = self.att_embedding(in_feature)
      emb_feature = self.dropout_layer(emb_feature)
      # multi-head self-attention network
      att_feature, _ = self.self_attn(
          emb_feature, emb_feature, emb_feature
      )  # [batch_size, num_field, att_dim]
      # Residual connection
      v_res = self.v_res_embedding(in_feature)
      att_feature += v_res
      att_feature = F.relu(att_feature).contiguous()
  
      # init graph
      src_emb = att_feature[:, self.src_nodes, :]
      dst_emb = att_feature[:, self.dst_nodes, :]
      concat_emb = torch.cat([src_emb, dst_emb], dim=-1)
      alpha = self.leaky_relu(self.W_attn(concat_emb))
      alpha = alpha.view(
          -1, self.num_feature_field, self.num_feature_field
      )
      mask = torch.eye(self.num_feature_field).to(self.device)
      alpha = alpha.masked_fill(mask.bool(), float("-inf"))
      self.graph = F.softmax(alpha, dim=-1)
      # message passing
      if self.n_layers > 1:
          h = att_feature
          for i in range(self.n_layers - 1):
              a = self.gnn[i](self.graph, h)
              a = a.view(-1, self.attention_size)
              h = h.view(-1, self.attention_size)
              h = self.gru_cell(a, h)
              h = h.view(
                  -1, self.num_feature_field, self.attention_size
              )
              h += att_feature
      else:
          h = att_feature
      # Attentional Scoring Layer
      score = self.mlp1(h).squeeze(-1)
      weight = self.mlp2(h.flatten(start_dim=1))
      logit = (weight * score).sum(dim=1).unsqueeze(-1)
      return logit
  
file_path: RecBole/recbole/model/context_aware_recommender/fignn.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn.init import xavier_uniform_, xavier_normal_, constant_
  from itertools import product
  from recbole.utils import InputType
  from recbole.model.abstract_recommender import ContextRecommender
label_desc: Use image node_id 2 for calling the FiGNN obj's underlying member method code with example usage: obj.fignn_layer(in_feature) and returns: logit