code: def monitor_metrics(self, outputs, targets):
      if targets is None:
          return {}
      device = targets.device.type
      outputs = torch.sigmoid(outputs).cpu().detach().numpy() >= 0.5
      targets = targets.cpu().detach().numpy()
      accuracy = metrics.accuracy_score(targets, outputs)
      return {"accuracy": torch.tensor(accuracy, device=device)}
  
file_path: tez/examples/nlp/imdb_sentiment_classification.py
imports: import pandas
  import torch
  import torch.nn
  from sklearn import metrics, model_selection
  from transformers import AutoConfig, AutoModel, AutoTokenizer, get_linear_schedule_with_warmup
  from tez import Tez, TezConfig
  from tez.callbacks import EarlyStopping
label_desc: Use image node_id 4 for calling the IMDBModel obj's underlying member method code with example usage: obj.monitor_metrics(outputs, targets) and returns: dict, dict