class_docstr: Class for fitting Gaussian processes. 
class_docstr_tok: ["Class","for","fitting","Gaussian","processes","."]
docstr: Sets up optimiser for ml hp tune. 
docstr_tok: ["Sets","up","optimiser","for","ml","hp","tune","."]
code: def _set_up_ml_hp_tune(self):
      """Sets up optimiser for ml hp tune."""
  
      # pylint: disable=too-many-branches
      # define the following internal functions to abstract things out more.
      def _direct_wrap(*args):
          """A wrapper so as to only return the optimal point."""
          opt_val, opt_pt, _ = direct_ft_maximise(*args)
          return opt_val, opt_pt, None
  
      def _pdoo_wrap(*args):
          """A wrapper so as to only return the optimal point."""
          opt_val, opt_pt, _ = pdoo_maximise(*args)
          return opt_val, opt_pt, None
  
      def _rand_wrap(*args):
          """A wrapper so as to only return the optimal point."""
          opt_val, opt_pt, _ = random_maximise(*args, vectorised=False)
          return opt_val, opt_pt, None
  
      def _rand_exp_sampling_wrap(*args):
          """A wrapper so as to only return the optimal point."""
          (
              sample_cts_hps,
              sample_dscr_hps,
              lml_vals,
          ) = random_sample_cts_dscr(*args, vectorised=False)
          sample_probs = np.exp(lml_vals - max(lml_vals))
          sample_probs = sample_probs / sample_probs.sum()
          return sample_cts_hps, sample_dscr_hps, sample_probs
  
      # Set some parameters
      if self.options.ml_hp_tune_opt == "default":
          self.ml_hp_tune_opt_method = _get_default_ml_hp_tune_opt(
              self.num_hps
          )
      else:
          self.ml_hp_tune_opt_method = self.options.ml_hp_tune_opt
      if (
          hasattr(self.options, "hp_tune_max_evals")
          and self.options.hp_tune_max_evals is not None
          and self.options.hp_tune_max_evals > 0
      ):
          self.hp_tune_max_evals = self.options.hp_tune_max_evals
      else:
          if self.ml_hp_tune_opt_method in ["direct", "pdoo"]:
              self.hp_tune_max_evals = min(
                  1e4, max(500, self.num_hps * 50)
              )
          elif self.ml_hp_tune_opt_method == "rand":
              self.hp_tune_max_evals = min(
                  1e4, max(500, self.num_hps * 200)
              )
          elif self.ml_hp_tune_opt_method == "rand_exp_sampling":
              self.hp_tune_max_evals = min(
                  1e5, max(500, self.num_hps * 400)
              )
      # Now set up the function that will be used for optimising
      if self.ml_hp_tune_opt_method == "direct":
          self.cts_hp_optimise = lambda obj, max_evals: _direct_wrap(
              obj, self.cts_hp_bounds, max_evals
          )
      elif self.ml_hp_tune_opt_method == "pdoo":
          self.cts_hp_optimise = lambda obj, max_evals: _pdoo_wrap(
              obj, self.cts_hp_bounds, max_evals
          )
      elif self.ml_hp_tune_opt_method == "rand":
          self.cts_hp_optimise = lambda obj, max_evals: _rand_wrap(
              obj, self.cts_hp_bounds, max_evals
          )
      elif self.ml_hp_tune_opt_method == "rand_exp_sampling":
          self.hp_sampler = (
              lambda obj, max_evals: _rand_exp_sampling_wrap(
                  obj, self.cts_hp_bounds, self.dscr_hp_vals, max_evals
              )
          )
  
imports: from __future__ import division
  from argparse import Namespace
  from itertools import product
  import sys
  import numpy
  from ..distributions.model import Model
  from ..distributions import continuous
  from ..distributions import discrete
  from ..utils.general_utils import stable_cholesky, draw_gaussian_samples, project_symmetric_to_psd_cone, solve_lower_triangular, solve_upper_triangular
  from ..utils.oper_utils import direct_ft_maximise, pdoo_maximise, random_maximise, random_sample_cts_dscr
  from ..utils.option_handler import get_option_specs, load_options
  from ..utils.reporters import get_reporter
label_desc: Use image node_id 7 for calling the GPFitter obj's underlying member method code with example usage: obj._set_up_ml_hp_tune() and returns: opt_val,  opt_pt,  None, opt_val,  opt_pt,  None, opt_val,  opt_pt,  None, sample_cts_hps,  sample_dscr_hps,  sample_probs