code: def train(
      optimizer,
      loss_fn,
      reg_fn,
      model,
      prep,
      dataloader,
      lambda_reg,
      device,
  ):
      total_loss = 0
      model.train()
      for i, (graph_batch, data_batch, label_batch) in enumerate(
          dataloader
      ):
          graph_batch = graph_batch.to(device)
          data_batch = data_batch.to(device)
          label_batch = label_batch.to(device)
          optimizer.zero_grad()
          node_feat, edge_feat = prep(graph_batch, data_batch)
          dummy_relation = (
              torch.zeros(edge_feat.shape[0], 1).float().to(device)
          )
          dummy_global = (
              torch.zeros(node_feat.shape[0], 1).float().to(device)
          )
          v_pred, out_e = model(
              graph_batch,
              node_feat[:, 3:5].float(),
              edge_feat.float(),
              dummy_global,
              dummy_relation,
          )
          loss = loss_fn(v_pred, label_batch)
          total_loss += float(loss)
          zero_target = torch.zeros_like(out_e)
          loss = loss + lambda_reg * reg_fn(out_e, zero_target)
          reg_loss = 0
          for param in model.parameters():
              reg_loss = reg_loss + lambda_reg * reg_fn(
                  param, torch.zeros_like(param).float().to(device)
              )
          loss = loss + reg_loss
          loss.backward()
          optimizer.step()
      return total_loss / (i + 1)
  
file_path: dgl/examples/pytorch/graphsim/train.py
imports: import argparse
  import time
  import traceback
  import dgl
  import networkx
  import numpy
  import torch
  from dataloader import MultiBodyGraphCollator, MultiBodyTestDataset, MultiBodyTrainDataset, MultiBodyValidDataset
  from models import InteractionNet, MLP, PrepareLayer
  from torch.utils.data import DataLoader
  from utils import make_video
label_desc: Use image node_id 1 for calling a global function with example usage: train(optimizer, loss_fn, reg_fn, model, prep, dataloader, lambda_reg, device) and returns: unknown