code: def __init__(
      self,
      in_dim,
      num_layers,
      hidden,
      pool_type="sum",
      model_type="gmnet",
      fuse_type="abs_diff",
      ogb=False,
      **kwargs,
  ):
      super(GraphMatching, self).__init__()
      self.dis_encoder = GMNet(
          in_dim,
          num_layers,
          hidden,
          pool_type=pool_type,
          ogb=ogb,
          **kwargs,
      )
  
      self.fuse_type = fuse_type
      if fuse_type == "concat":
          self.pred_head = nn.Sequential(
              nn.Linear(2 * hidden, 2 * hidden),
              nn.ReLU(),
              nn.Linear(2 * hidden, 1),
              nn.Sigmoid(),
          )
      elif fuse_type == "cos":
          self.pred_head = nn.Sequential(
              nn.Linear(hidden, 2 * hidden),
              nn.ReLU(),
              nn.Linear(2 * hidden, hidden),
          )
          self.cos = torch.nn.CosineSimilarity(dim=1)
      else:
          in_hidden = hidden
          self.pred_head = nn.Sequential(
              nn.Linear(in_hidden, 2 * hidden),
              nn.ReLU(),
              nn.Linear(2 * hidden, 1),
              nn.Sigmoid(),
          )
  
imports: import torch
  import torch.nn
  from .GMNET import GMNet
label_desc: Use image node_id 1 to create a new GraphMatching object from inherited base classes: torch.nn with example: obj = GraphMatching(in_dim, num_layers, hidden, pool_type, model_type, fuse_type, ogb)