code: def evaluate(model, loss_fn, dataloader, device="cpu"):
      loss = 0
      auc = 0
      recall = 0
      num_blocks = 0
      for input_nodes, output_nodes, blocks in dataloader:
          blocks = [b.to(device) for b in blocks]
          feature = blocks[0].srcdata["feature"]
          label = blocks[-1].dstdata["label"]
          logits_gnn, logits_sim = model(blocks, feature)
  
          # compute loss
          loss += (
              loss_fn(logits_gnn, label).item()
              + args.sim_weight * loss_fn(logits_sim, label).item()
          )
          recall += recall_score(
              label.cpu(), logits_gnn.argmax(dim=1).detach().cpu()
          )
          auc += roc_auc_score(
              label.cpu(),
              softmax(logits_gnn, dim=1)[:, 1].detach().cpu(),
          )
          num_blocks += 1
  
      return recall / num_blocks, auc / num_blocks, loss / num_blocks
  
file_path: dgl/examples/pytorch/caregnn/main_sampling.py
imports: import argparse
  import dgl
  import torch
  import torch.optim
  from model_sampling import _l1_dist, CAREGNN, CARESampler
  from sklearn.metrics import recall_score, roc_auc_score
  from torch.nn.functional import softmax
  from utils import EarlyStopping
label_desc: Use image node_id 1 for calling a global function with example usage: evaluate(model, loss_fn, dataloader, device) and returns: unknown,  unknown,  unknown