code: def JSE_local_global_negative_paired(z_g, z_n, batch):
      """
      Args:
          z_g: of size [2*n_batch, dim]
          z_n: of size [2*n_batch*nodes_per_batch, dim]
      """
      device = z_g.device
      num_graphs = int(z_g.shape[0] / 2)  # 4
      num_nodes = int(z_n.shape[0] / 2)  # 4*2000
      z_g, _ = torch.split(z_g, num_graphs)
      z_n, z_n_crpt = torch.split(z_n, num_nodes)
  
      num_sample_nodes = int(num_nodes / num_graphs)
      z_n = torch.split(z_n, num_sample_nodes)
      z_n_crpt = torch.split(z_n_crpt, num_sample_nodes)
  
      d_pos = torch.cat(
          [torch.matmul(z_g[i], z_n[i].t()) for i in range(num_graphs)]
      )  # [1, 8000]
      d_neg = torch.cat(
          [
              torch.matmul(z_g[i], z_n_crpt[i].t())
              for i in range(num_graphs)
          ]
      )  # [1, 8000]
  
      logit = torch.unsqueeze(
          torch.cat((d_pos, d_neg)), 0
      )  # [1, 16000]
      lb_pos = torch.ones((1, num_nodes)).to(device)  # [1, 8000]
      lb_neg = torch.zeros((1, num_nodes)).to(device)  # [1, 8000]
      lb = torch.cat((lb_pos, lb_neg), 1)
  
      b_xent = nn.BCEWithLogitsLoss()
      loss = b_xent(logit, lb) * 0.5  # following mvgrl-node
      return loss
  
file_path: DIG/dig/sslgraph/method/contrastive/objectives/jse.py
imports: import itertools
  import numpy
  import torch
  import torch.nn.functional
  import torch.nn
label_desc: Use image node_id 2 for calling a global function with example usage: JSE_local_global_negative_paired(z_g, z_n, batch) and returns: loss