code: def _train_test_with_lrc(
      model, features, labels, train_mask, test_mask
  ):
      """Under the pre-defined balanced train/test label setting, train a lrc to evaluate the embedding results."""
      optimizer = torch.optim.Adam(
          model.parameters(), lr=0.2, weight_decay=5e-06
      )
      for _ in range(100):
          model.train()
          optimizer.zero_grad()
          output = model(features)
          loss_train = F.cross_entropy(
              output[train_mask], labels[train_mask]
          )
          loss_train.backward()
          optimizer.step()
      return _evaluate(
          model=model,
          features=features,
          labels=labels,
          test_mask=test_mask,
      )
  
file_path: dgl/examples/pytorch/rect/classify.py
imports: from statistics import mean
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 2 for calling a global function with example usage: _train_test_with_lrc(model, features, labels, train_mask, test_mask) and returns: _evaluate