class_docstr: Implementation of single layer of interaction network
  Parameters
  ==========
  in_node_feats : int
      Number of node features
  
  in_edge_feats : int
      Number of edge features
  
  out_node_feats : int
      Number of node feature after one interaction
  
  out_edge_feats : int
      Number of edge features after one interaction
  
  global_feats : int
      Number of global features used as input
  
  relate_feats : int
      Feature related to the relation between object themselves
  
  edge_fn : torch.nn.Module
      Function to update edge feature in message generation
  
  node_fn : torch.nn.Module
      Function to update node feature in message aggregation
  
  mode : str
      Type of message should the edge carry
      nne : [src_feat,dst_feat,edge_feat] node feature concat edge feature.
      n_n : [src_feat-edge_feat] node feature subtract from each other.
class_docstr_tok: ["Implementation","of","single","layer","of","interaction","network","Parameters","==========","in_node_feats",":","int","Number","of","node","features","in_edge_feats",":","int","Number","of","edge","features","out_node_feats",":","int","Number","of","node","feature","after","one","interaction","out_edge_feats",":","int","Number","of","edge","features","after","one","interaction","global_feats",":","int","Number","of","global","features","used","as","input","relate_feats",":","int","Feature","related","to","the","relation","between","object","themselves","edge_fn",":","torch.nn.Module","Function","to","update","edge","feature","in","message","generation","node_fn",":","torch.nn.Module","Function","to","update","node","feature","in","message","aggregation","mode",":","str","Type","of","message","should","the","edge","carry","nne",":","[","src_feat",",","dst_feat",",","edge_feat","]","node","feature","concat","edge","feature",".","n_n",":","[","src_feat-edge_feat","]","node","feature","subtract","from","each","other","."]
code: def __init__(
      self,
      in_node_feats,
      in_edge_feats,
      out_node_feats,
      out_edge_feats,
      global_feats=1,
      relate_feats=1,
      edge_fn=nn.Linear,
      node_fn=nn.Linear,
      mode="nne",
  ):  # 'n_n'
      super(InteractionLayer, self).__init__()
      self.in_node_feats = in_node_feats
      self.in_edge_feats = in_edge_feats
      self.out_edge_feats = out_edge_feats
      self.out_node_feats = out_node_feats
      self.mode = mode
      # MLP for message passing
      input_shape = (
          2 * self.in_node_feats + self.in_edge_feats
          if mode == "nne"
          else self.in_edge_feats + relate_feats
      )
      self.edge_fn = edge_fn(
          input_shape, self.out_edge_feats
      )  # 50 in IN paper
  
      self.node_fn = node_fn(
          self.in_node_feats + self.out_edge_feats + global_feats,
          self.out_node_feats,
      )
  
imports: import copy
  from functools import partial
  import dgl
  import dgl.function
  import dgl.nn
  import torch
  import torch.nn
  from torch.nn import functional
label_desc: Use image node_id 1 to create a new InteractionLayer object from inherited base classes: nn with example: obj = InteractionLayer(in_node_feats, in_edge_feats, out_node_feats, out_edge_feats, global_feats, relate_feats, edge_fn, node_fn, mode)