code: def _compute_acq_withGradients(self, x):
          
          means, stds, dmdxs, dsdxs = self.model.predict_withGradients(x)
          f_acqu = None
          df_acqu = None
          for m, s, dmdx, dsdx in zip(means, stds, dmdxs, dsdxs):  
              f = -m + self.exploration_weight * s        
              df = -dmdx + self.exploration_weight * dsdx
              if f_acqu is None:
                  f_acqu = f        
                  df_acqu = df
              else:
                  f_acqu += f
                  df_acqu += df
          return f_acqu/(len(means)), df_acqu/(len(means))
docs: Integrated GP-Lower Confidence Bound and its derivative