code: def train():
      model.train()
      total_loss = 0
      for pos_rw, neg_rw in loader:
          optimizer.zero_grad()
          loss = model.loss(pos_rw.to(device), neg_rw.to(device))
          loss.backward()
          optimizer.step()
          total_loss += loss.item()
      return total_loss / len(loader)
  
file_path: pytorch_geometric/examples/node2vec.py
imports: import os.path
  import sys
  import matplotlib.pyplot
  import torch
  from sklearn.manifold import TSNE
  from torch_geometric.datasets import Planetoid
  from torch_geometric.nn import Node2Vec
label_desc: Use image node_id 1 for calling a global function with example usage: train() and returns: unknown