code: def check_grad_ei_per(self, cand, comp, vals, durs):
      (ei, dx1) = self.grad_optimize_ei_over_hypers(
          cand, comp, vals, durs
      )
      dx2 = dx1 * 0
      idx = np.zeros(cand.shape[0])
      for i in range(0, cand.shape[0]):
          idx[i] = 1e-6
          (ei1, tmp) = self.grad_optimize_ei_over_hypers(
              cand + idx, comp, vals, durs
          )
          (ei2, tmp) = self.grad_optimize_ei_over_hypers(
              cand - idx, comp, vals, durs
          )
          dx2[i] = (ei - ei2) / (2 * 1e-6)
          idx[i] = 0
      log("computed grads %s" % dx1)
      log("finite diffs %s" % dx2)
      log(dx1 / dx2)
      log(np.sum((dx1 - dx2) ** 2))
      time.sleep(2)
  
imports: import os
  from ..None import gp
  import sys
  from ..None import util
  import tempfile
  import numpy
  import numpy.random
  import scipy.linalg
  import scipy.stats
  import scipy.optimize
  import pickle
  from ..helpers import *
  from ..Locker import *
  import logging
label_desc: Use image node_id 7 for calling the GPEIperSecChooser obj's underlying member method code with example usage: obj.check_grad_ei_per(cand, comp, vals, durs) without return types