docstr: this is why we're here - do inference 
docstr_tok: ["this","is","why","we","'re","here","-","do","inference"]
code: def run_inference(self, x_train, y_train, x_predict, print=False):
      """this is why we're here - do inference"""
  
      if self.kernel_type == "relu" or self.kernel_type == "softplus":
          kernel = NNKernelRelu
      elif self.kernel_type == "Lrelu":
          kernel = NNKernelLRelu
      elif self.kernel_type == "erf":
          kernel = NNKernelErf
      elif self.kernel_type == "gelu":
          kernel = NNKernelGelu
      elif self.kernel_type == "elu":
          kernel = NNKernelElu
  
      x_dim = x_train.shape[1]
      kern = kernel(
          x_dim,
          [self.w_0_var, self.w_1_var],
          0,
          [self.b_0_var, 0],
          0,
          L=1,
      )
      kernel_fn = lambda x1, x2: kern.K(x1, x2)
  
      # d is training data, x is test data
      if print:
          print_w_time("beginning inference")
      cov_dd = (
          kernel_fn(x_train, None)
          + np.identity(x_train.shape[0]) * self.data_noise
      )
  
      if print:
          print_w_time("compiled cov_dd")
      cov_xd = kernel_fn(x_predict, x_train)
      if print:
          print_w_time("compiled cov_xd")
      cov_xx = kernel_fn(x_predict, x_predict)
      if print:
          print_w_time("compiled cov_xx")
  
      # p 19 of Rasmussen & Williams
      L = np.linalg.cholesky(cov_dd)
      alpha = np.linalg.solve(L.T, np.linalg.solve(L, y_train))
      y_pred_mu = np.matmul(cov_xd, alpha)
      v = np.linalg.solve(L, cov_xd.T)
      cov_pred = cov_xx - np.matmul(v.T, v)
  
      y_pred_var = np.atleast_2d(np.diag(cov_pred) + self.data_noise).T
      y_pred_std = np.sqrt(y_pred_var)
  
      if print:
          print_w_time("calculating log likelihood")
      marg_log_like = (
          -np.matmul(y_train.T, alpha) / 2
          - np.sum(np.log(np.diag(L)))
          - x_train.shape[0] * np.log(2 * np.pi) / 2
      )
  
      if print:
          print_w_time("matrix ops complete")
  
      self.cov_xx = cov_xx
      self.cov_dd = cov_dd
      self.cov_xd = cov_xd
      self.cov_xx = cov_xx
      self.cov_pred = cov_pred
      self.y_pred_mu = y_pred_mu
      self.y_pred_std = y_pred_std
      self.y_pred_var = y_pred_var
      self.x_train = x_train
      self.y_train = y_train
      self.x_predict = x_predict
  
      self.y_pred_mu = y_pred_mu
      self.y_pred_std = y_pred_std
      self.marg_log_like = marg_log_like
  
      return y_pred_mu, y_pred_std
  
file_path: elu-gelu-kernels/code/experiments/02_shallow_experiments/module_gp_gelu.py
imports: import numpy
  from .utils import *
  from ...kernels.nn_kernel_relu import NNKernelRelu
  from ...kernels.nn_kernel_gelu import NNKernelGelu
  from ...kernels.nn_kernel_lrelu import NNKernelLRelu
  from ...kernels.nn_kernel_elu import NNKernelElu
  from ...kernels.nn_kernel_erf import NNKernelErf
label_desc: Use image node_id 2 for calling the gp_model obj's underlying member method code with example usage: obj.run_inference(x_train, y_train, x_predict, print) and returns: y_pred_mu,  y_pred_std