class_docstr: Implements the ESP kernel from Kandasamy, Yu 2016, 'Additive Approximations in High
  Dimensional Nonparametric Regression. 
class_docstr_tok: ["Implements","the","ESP","kernel","from","Kandasamy",",","Yu","2016",",","'Additive","Approximations","in","High","Dimensional","Nonparametric","Regression","."]
docstr: computes the gram matrix
docstr_tok: ["computes","the","gram","matrix"]
code: def _child_evaluate(self, X1, X2):
      "computes the gram matrix"
      # pylint: disable=too-many-locals
      order = self.hyperparams["order"]
      kernel_list = self.kernel_list
      scale = self.hyperparams["scale"]
      if isinstance(X1, list):
          X1 = np.array(X1)
      if isinstance(X2, list):
          X2 = np.array(X2)
      n1 = X1.shape[0]
      n2 = X2.shape[0]
      kernel_matrices = []
      for i in range(self.dim):
          kernel = kernel_list[i]
          kernel_matrices.append(
              kernel(X1[:, i : i + 1], X2[:, i : i + 1])
          )
      power_sum = [np.zeros((n1, n2)) for _ in range(order + 1)]
      ones = np.ones((n1, n2))
      power_sum[0] = ones
      for i in range(1, order + 1):
          for matrix in kernel_matrices:
              power_sum[i] += matrix**i
      # elementary symmetric polynomials
      esp = [np.zeros((n1, n2)) for _ in range(order + 1)]
      esp[0] = ones
      for m in range(1, order + 1):
          for i in range(1, m + 1):
              esp[m] += ((-1) ** (i - 1)) * esp[m - i] * power_sum[i]
          esp[m] /= m
      return scale * esp[order]
  
imports: from __future__ import print_function
  import numpy
  from scipy.linalg import solve_triangular
label_desc: Use image node_id 2 for calling the ESPKernel obj's underlying member method code with example usage: obj._child_evaluate(X1, X2) and returns: unknown