code: def get_confidence_metric(y_pred, y_pred_adv):
      y_classidx = np.argmax(y_pred, axis=1)
      y_classconf = y_pred[np.arange(y_pred.shape[0]), y_classidx]
  
      y_adv_classidx = np.argmax(y_pred_adv, axis=1)
      y_adv_classconf = y_pred_adv[
          np.arange(y_pred_adv.shape[0]), y_adv_classidx
      ]
  
      idxs = y_classidx == y_adv_classidx
  
      if np.sum(idxs) == 0.0:
          return 0
  
      idxnonzero = y_classconf != 0
      idxs = idxs & idxnonzero
  
      return np.mean(
          (y_classconf[idxs] - y_adv_classconf[idxs])
          / y_classconf[idxs]
      )
  
file_path: adversarial-robustness-toolbox/utils/mlops/kubeflow/robustness_evaluation_fgsm_pytorch/src/robustness_util.py
imports: import numpy
  import numpy.linalg
  import torch
  import torch.utils.data
  from torch.autograd import Variable
label_desc: Use image node_id 4 for calling a global function with example usage: get_confidence_metric(y_pred, y_pred_adv) and returns: np, int