code: def build_deep_gp(
      input_dimension, hidden_dimension, covariance_function
  ):
      # GP going from input to hidden
      (
          num_params_layer1,
          predict_layer1,
          log_marginal_likelihood_layer1,
      ) = make_gp_funs(
          covariance_function, num_cov_params=input_dimension + 1
      )
  
      # GP going from hidden to output
      (
          num_params_layer2,
          predict_layer2,
          log_marginal_likelihood_layer2,
      ) = make_gp_funs(
          covariance_function, num_cov_params=hidden_dimension + 1
      )
  
      num_hidden_params = hidden_dimension * n_data
      total_num_params = (
          num_params_layer1 + num_params_layer2 + num_hidden_params
      )
  
      def unpack_all_params(all_params):
          layer1_params = all_params[:num_params_layer1]
          layer2_params = all_params[
              num_params_layer1 : num_params_layer1 + num_params_layer2
          ]
          hiddens = all_params[num_params_layer1 + num_params_layer2 :]
          return layer1_params, layer2_params, hiddens
  
      def combined_predict_fun(all_params, X, y, xs):
          layer1_params, layer2_params, hiddens = unpack_all_params(
              all_params
          )
          h_star_mean, h_star_cov = predict_layer1(
              layer1_params, X, hiddens, xs
          )
          y_star_mean, y_star_cov = predict_layer2(
              layer2_params,
              np.atleast_2d(hiddens).T,
              y,
              np.atleast_2d(h_star_mean).T,
          )
          return y_star_mean, y_star_cov
  
      def log_marginal_likelihood(all_params):
          layer1_params, layer2_params, h = unpack_all_params(
              all_params
          )
          return log_marginal_likelihood_layer1(
              layer1_params, X, h
          ) + log_marginal_likelihood_layer2(
              layer2_params, np.atleast_2d(h).T, y
          )
  
      predict_layer_funcs = [predict_layer1, predict_layer2]
  
      return (
          total_num_params,
          log_marginal_likelihood,
          combined_predict_fun,
          unpack_all_params,
          predict_layer_funcs,
      )
  
file_path: autograd/examples/deep_gaussian_process.py
imports: from __future__ import absolute_import
  from __future__ import print_function
  import matplotlib.pyplot
  import autograd.numpy
  import autograd.numpy.random
  from autograd import value_and_grad
  from scipy.optimize import minimize
  from gaussian_process import make_gp_funs, rbf_covariance
label_desc: Use image node_id 2 for calling a global function with example usage: build_deep_gp(input_dimension, hidden_dimension, covariance_function) and returns: total_num_params,  log_marginal_likelihood,  combined_predict_fun,  unpack_all_params,  predict_layer_funcs, layer1_params,  layer2_params,  hiddens, y_star_mean,  y_star_cov, unknown