Commits

Ruben Martinez-Cantin committed 6b68c59

Changes in parameters schema. Still requires some changes for Python/Matlab

Comments (0)

Files changed (14)

 
 Ruben Martinez-Cantin, **BayesOpt: a toolbox for
 nonlinear-optimization, experimental design and stochastic bandits**,
-<http://bitbucket.org/rmcantin/bayesian-optimization>
+<http://bitbucket.org/rmcantin/bayesopt>
 
 ----------------------------------------------------------------------
 

app/bo_branin.cpp

   bopt_params par = initialize_parameters_to_default();
   par.n_iterations = 200;
   par.n_init_samples = 50;
-  par.theta[0] = 1.0;
-  par.n_theta = 1;
-  par.c_name = C_GP_HEDGE;
+  par.kernel.theta[0] = 1.0;
+  par.kernel.n_theta = 1;
+  par.crit_name = "cHedge(cEI,cLCB,cPOI)";
   
   ExampleBranin branin(2,par);
   vectord result(2);
   // the we can optionally change only few of them 
   bopt_params par = initialize_parameters_to_default();
 
-  par.theta[0] = KERNEL_THETA;
-  par.theta[1] = KERNEL_THETA;
-  par.s_theta[0] = 1;
-  par.s_theta[1] = 1;
-  par.n_theta = 2;
-  par.mu[0] = 1.0;
-  par.n_mu = 1;
+  par.kernel.theta[0] = KERNEL_THETA;
+  par.kernel.theta[1] = KERNEL_THETA;
+  par.kernel.s_theta[0] = 1;
+  par.kernel.s_theta[1] = 1;
+  par.kernel.n_theta = 2;
+  par.mean.mu[0] = 1.0;
+  par.mean.s_mu[0] = PRIOR_DELTA_SQ;
+  par.mean.n_mu = 1;
   par.alpha = PRIOR_ALPHA;
   par.beta = PRIOR_BETA;
-  par.delta = PRIOR_DELTA_SQ;
   par.noise = DEFAULT_NOISE;
-  par.c_name = C_EI;
-  par.s_name = S_STUDENT_T_PROCESS_JEFFREYS;
-  par.k_name = K_MATERN_ISO3;
-  par.k_s_name = "kSum(kSEISO,kConst)";
-  par.m_name = M_ZERO;
-  par.m_s_name = "mConst";
+  par.surr_name = S_STUDENT_T_PROCESS_JEFFREYS;
+  par.kernel.name = "kSum(kSEISO,kConst)";
+  par.mean.name = "mConst";
   par.n_iterations = 200;       // Number of iterations
   par.n_init_samples = 50;
   par.verbose_level = 2;
   // the we can optionally change only few of them 
   bopt_params par = initialize_parameters_to_default();
 
-  par.theta[0] = KERNEL_THETA;
-  par.n_theta = 1;
+  par.kernel.theta[0] = KERNEL_THETA;
+  par.kernel.s_theta[0] = 100.0;
+  par.kernel.n_theta = 1;
   par.alpha = PRIOR_ALPHA;
   par.beta = PRIOR_BETA;
-  par.delta = PRIOR_DELTA_SQ;
+  par.mean.mu[0] = 0.0;
+  par.mean.s_mu[0] = PRIOR_DELTA_SQ;
+  par.mean.n_mu = 1;
   par.noise = DEFAULT_NOISE;
-  par.c_name = C_EI;
-  par.s_name = S_GAUSSIAN_PROCESS_INV_GAMMA_NORMAL;
-  par.k_name = K_MATERN_ISO3;
+  par.surr_name = S_GAUSSIAN_PROCESS_INV_GAMMA_NORMAL;
   par.n_iterations = 20;       // Number of iterations
   par.n_init_samples = 20;
   /*******************************************/
   size_t dim = 1;
   bopt_params parameters = initialize_parameters_to_default();
   parameters.n_iterations = 300;
-  parameters.theta[0] = 1.0;
-  parameters.n_theta = 1;
-  parameters.c_s_name = "cHedge(cEI,cLCB,cExpReturn,cOptimisticSampling)";
+  parameters.kernel.theta[0] = 1.0;
+  parameters.kernel.s_theta[0] = 100.0;
+  parameters.kernel.n_theta = 1;
+  parameters.crit_name = "cHedge(cEI,cLCB,cExpReturn,cOptimisticSampling)";
 
   ExampleOneD opt(dim,parameters);
   vectord result(dim);

include/criteria_functors.hpp

     CriteriaFactory ();
     virtual ~CriteriaFactory () {};
   
-    Criteria* create(criterium_name name, NonParametricProcess* proc);
+    //Criteria* create(criterium_name name, NonParametricProcess* proc);
     Criteria* create(std::string name, NonParametricProcess* proc);
     
   private:

include/nonparametricprocess.hpp

     inline double getValueAtMinimum() { return mGPY(mMinIndex); };
   
 
+    // /** 
+    //  * \brief Select kernel (covariance function) for the surrogate process.
+    //  * @param thetav kernel parameters
+    //  * @param k_name kernel name
+    //  * @return error_code
+    //  */
+    // int setKernel (const vectord &thetav, kernel_name k_name, size_t dim);
+
+    // /** 
+    //  * \brief Wrapper of setKernel for c arrays
+    //  */
+    // inline int setKernel (const double *theta, size_t n_theta, 
+    // 			  kernel_name k_name, size_t dim)
+    // {
+    //   vectord th(n_theta);
+    //   std::copy(theta, theta+n_theta, th.begin());
+    //   int error = setKernel(th, k_name, dim);
+    // };
+
     /** 
      * \brief Select kernel (covariance function) for the surrogate process.
-     * @param thetav kernel parameters
+     * @param thetav kernel parameters (mean)
+     * @param stheta kernel parameters (std)
      * @param k_name kernel name
      * @return error_code
      */
-    int setKernel (const vectord &thetav, kernel_name k_name, size_t dim);
+    int setKernel (const vectord &thetav, const vectord &stheta, 
+		   std::string k_name, size_t dim);
 
     /** 
      * \brief Wrapper of setKernel for c arrays
      */
-    inline int setKernel (const double *theta, size_t n_theta, 
-			  kernel_name k_name, size_t dim)
+    inline int setKernel (kernel_parameters kernel, size_t dim)
     {
-      vectord th(n_theta);
-      std::copy(theta, theta+n_theta, th.begin());
-      int error = setKernel(th, k_name, dim);
+      size_t n = kernel.n_theta;
+      vectord th(n);
+      vectord sth(n);
+      std::copy(kernel.theta, kernel.theta+n, th.begin());
+      std::copy(kernel.s_theta, kernel.s_theta+n, sth.begin());
+      int error = setKernel(th, sth, kernel.name, dim);
     };
 
-    /** 
-     * \brief Select kernel (covariance function) for the surrogate process.
-     * @param thetav kernel parameters
-     * @param k_name kernel name
-     * @return error_code
-     */
-    int setKernel (const vectord &thetav, std::string k_name, size_t dim);
-
-    /** 
-     * \brief Wrapper of setKernel for c arrays
-     */
-    inline int setKernel (const double *theta, size_t n_theta, 
-			  std::string k_name, size_t dim)
+    /** Set prior (Gaussian) for kernel hyperparameters */
+    inline int setKernelPrior (const vectord &theta, const vectord &s_theta)
     {
-      vectord th(n_theta);
-      std::copy(theta, theta+n_theta, th.begin());
-      int error = setKernel(th, k_name, dim);
+      size_t n_theta = theta.size();
+      for (size_t i = 0; i<n_theta; ++i)
+	{
+	  boost::math::normal n(theta(i),s_theta(i));
+	  priorKernel.push_back(n);
+	}
+      return 0;
     };
 
-    /** 
-     * \brief Wrapper of setKernel for c arrays
-     */
-    inline int setKernelPrior (const double *theta, const double *s_theta,
-			       size_t n_theta)
-    {
-      for (size_t i = 0; i<n_theta; ++i)
-	{
-	  boost::math::normal n(theta[i],s_theta[i]);
-	  priorKernel.push_back(n);
-	}
-    };
 
 
+    // /** 
+    //  * \brief Select the parametric part of the surrogate process.
+    //  * 
+    //  * @param muv mean function parameters
+    //  * @param m_name mean function name
+    //  * @return error_code
+    //  */
+    // int setMean (const vectord &muv, mean_name m_name, size_t dim);
+
+    // /** 
+    //  * \brief Wrapper of setMean for c arrays
+    //  */
+    // inline int setMean (const double *mu, size_t n_mu, 
+    // 			mean_name m_name, size_t dim)
+    // {
+    //   vectord vmu(n_mu);
+    //   std::copy(mu, mu+n_mu, vmu.begin());
+    //   return setMean(vmu, m_name, dim);
+    // };
+
 
     /** 
      * \brief Select the parametric part of the surrogate process.
      * 
      * @param muv mean function parameters
+     * @param smu std function parameters
      * @param m_name mean function name
+     * @param dim number of input dimensions
      * @return error_code
      */
-    int setMean (const vectord &muv, mean_name m_name, size_t dim);
+    int setMean (const vectord &muv, const vectord &smu, 
+		 std::string m_name, size_t dim);
 
     /** 
      * \brief Wrapper of setMean for c arrays
      */
-    inline int setMean (const double *mu, size_t n_mu, 
-			mean_name m_name, size_t dim)
+    inline int setMean (mean_parameters mean, size_t dim)
     {
+      size_t n_mu = mean.n_mu;
       vectord vmu(n_mu);
-      std::copy(mu, mu+n_mu, vmu.begin());
-      return setMean(vmu, m_name, dim);
-    };
-
-
-    /** 
-     * \brief Select the parametric part of the surrogate process.
-     * 
-     * @param muv mean function parameters
-     * @param m_name mean function name
-     * @return error_code
-     */
-    int setMean (const vectord &muv, std::string m_name, size_t dim);
-
-    /** 
-     * \brief Wrapper of setMean for c arrays
-     */
-    inline int setMean (const double *mu, size_t n_mu, 
-			std::string m_name, size_t dim)
-    {
-      vectord vmu(n_mu);
-      std::copy(mu, mu+n_mu, vmu.begin());
-      return setMean(vmu, m_name, dim);
+      vectord smu(n_mu);
+      std::copy(mean.mu, mean.mu+n_mu, vmu.begin());
+      std::copy(mean.s_mu, mean.s_mu+n_mu, smu.begin());
+      return setMean(vmu, smu, mean.name, dim);
     };
 
 

include/parameters.h

     S_ERROR = -1
   } surrogate_name;
 
+  /** Kernel configuration parameters */
+  typedef struct {
+
+    char*  name;                 /**< Name of the kernel function */
+    double theta[128];           /**< Kernel hyperparameters prior (mean) */
+    double s_theta[128];         /**< Kernel hyperparameters prior (std) */
+    size_t n_theta;              /**< Number of kernel hyperparameters */
+
+  } kernel_parameters;
+
+  typedef struct {
+    
+    char* name;                  /**< Name of the mean function */
+    double mu[128];              /**< Function hyperparameters (mean) */
+    double s_mu[128];            /**< Function hyperparameters (std) */
+    size_t n_mu;                 /**< Number of mean funct. hyperparameters */
+
+  } mean_parameters;
+
   /** \brief Configuration parameters */
   typedef struct {
 
     size_t verbose_level;        /**< 1-Error,2-Warning,3-Info. 4-6 log file*/
     char* log_filename;          /**< Log file path (if applicable) */
 
-    double theta[128];           /**< Kernel hyperparameters prior (mean) */
-    double s_theta[128];         /**< Kernel hyperparameters prior (std) */
-    size_t n_theta;              /**< Number of kernel hyperparameters */
-
-    double mu[128];              /**< Mean function hyperparameters */
-    size_t n_mu;                 /**< Number of mean funct. hyperparameters */
-
+    surrogate_name surr_name;    /**< Name of the surrogate function */
     double alpha;                /**< Inverse Gamma prior for signal var */
     double beta;                 /**< Inverse Gamma prior for signal var*/
-    double delta;                /**< Normal prior for mean hyperparameters */
     double noise;                /**< Observation noise (and nugget) */
 
-    surrogate_name s_name;       /**< Name of the surrogate function */
-    kernel_name k_name;          /**< Name of the kernel funct. -DEPRECATED-*/
-    char* k_s_name;              /**< Name of the kernel function */
-    criterium_name c_name;       /**< Name of the criterion -DEPRECATED-*/
-    char* c_s_name;              /**< Name of the criterion */
-    mean_name m_name;            /**< Name of the mean funct. -DEPRECATED-*/
-    char* m_s_name;              /**< Name of the mean function */
+    kernel_parameters kernel;    /**< Kernel parameters */
+    mean_parameters mean;        /**< Mean (parametric function) parameters */
+
+    char* crit_name;             /**< Name of the criterion */
 
   } bopt_params;
 
   const double KERNEL_THETA    = 1.0;
   const double KERNEL_SIGMA    = 10.0;
   const double MEAN_MU         = 1.0;
+  const double MEAN_SIGMA      = 1000.0;
   const double PRIOR_ALPHA     = 1.0;
   const double PRIOR_BETA      = 1.0;
   const double PRIOR_DELTA_SQ  = 1000.0;
   const size_t DEFAULT_VERBOSE     = 1;
 
   /* Algorithm limits */
-  const size_t MAX_ITERATIONS  = 1000;       /* Not used */
-  const size_t MAX_DIM         = 40;         /* Not used */
+  const size_t MAX_ITERATIONS  = 1000;        /**< Used if n_iterations <0 */
+  //  const size_t MAX_DIM         = 40;         /* Not used */
 
   /* INNER Optimizer default values */
-  const size_t MAX_INNER_EVALUATIONS = 500;   /*Used per dimmension */
-  const size_t MAX_INNER_ITERATIONS  = 3000; /* Not used */
+  const size_t MAX_INNER_EVALUATIONS = 500;   /**< Used per dimmension */
+  //  const size_t MAX_INNER_ITERATIONS  = 3000; /* Not used */
 
   /* Latin Hypercube Sampling (LHS) default values */
-  const size_t N_LHS_EVALS_PER_DIM = 30;     /* Not used */
-  const size_t MAX_LHS_EVALUATIONS = 100;    /* Not used */
+  //  const size_t N_LHS_EVALS_PER_DIM = 30;     /* Not used */
+  //  const size_t MAX_LHS_EVALUATIONS = 100;    /* Not used */
 
-  const size_t N_ALGORITHMS_IN_GP_HEDGE = 5;
-  const criterium_name ALGORITHMS_IN_GP_HEDGE[] = { C_EI, C_LCB, C_POI,
-						    C_EXPECTED_RETURN,
-						    C_OPTIMISTIC_SAMPLING };
+  //  const size_t N_ALGORITHMS_IN_GP_HEDGE = 5;
+  //  const criterium_name ALGORITHMS_IN_GP_HEDGE[] = { C_EI, C_LCB, C_POI,
+  //						    C_EXPECTED_RETURN,
+  //						    C_OPTIMISTIC_SAMPLING };
 
   /*************************************************************/
   /* These functions are added to simplify wrapping code       */

python/bayesopt.cpp

-/* Generated by Cython 0.16 on Fri Mar  1 17:20:58 2013 */
+/* Generated by Cython 0.16 on Mon Apr  1 20:05:37 2013 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
 static char __pyx_k__s_name[] = "s_name";
 static char __pyx_k__dparams[] = "dparams";
 static char __pyx_k__n_theta[] = "n_theta";
+static char __pyx_k__s_theta[] = "s_theta";
 static char __pyx_k__valid_x[] = "valid_x";
 static char __pyx_k____main__[] = "__main__";
 static char __pyx_k____test__[] = "__test__";
 static char __pyx_k__bayesopt[] = "bayesopt";
-static char __pyx_k__k_s_name[] = "k_s_name";
 static char __pyx_k__optimize[] = "optimize";
 static char __pyx_k__min_value[] = "min_value";
 static char __pyx_k__ValueError[] = "ValueError";
 static PyObject *__pyx_n_s__f;
 static PyObject *__pyx_n_s__initialize_params;
 static PyObject *__pyx_n_s__k_name;
-static PyObject *__pyx_n_s__k_s_name;
 static PyObject *__pyx_n_s__lb;
 static PyObject *__pyx_n_s__log_filename;
 static PyObject *__pyx_n_s__m_name;
 static PyObject *__pyx_n_s__params;
 static PyObject *__pyx_n_s__range;
 static PyObject *__pyx_n_s__s_name;
+static PyObject *__pyx_n_s__s_theta;
 static PyObject *__pyx_n_s__theta;
 static PyObject *__pyx_n_s__ub;
 static PyObject *__pyx_n_s__valid_x;
 static PyObject *__pyx_k_codeobj_18;
 static PyObject *__pyx_k_codeobj_20;
 
-/* "bayesopt.pyx":89
+/* "bayesopt.pyx":96
  * 
  * ###########################################################################
  * cdef bopt_params dict2structparams(dict dparams):             # <<<<<<<<<<<<<<
 static bopt_params __pyx_f_8bayesopt_dict2structparams(PyObject *__pyx_v_dparams) {
   bopt_params __pyx_v_params;
   PyObject *__pyx_v_logname = NULL;
+  PyObject *__pyx_v_surrogate = NULL;
   PyObject *__pyx_v_theta = NULL;
+  PyObject *__pyx_v_stheta = NULL;
   long __pyx_v_i;
   PyObject *__pyx_v_mu = NULL;
-  PyObject *__pyx_v_criteria = NULL;
-  PyObject *__pyx_v_surrogate = NULL;
-  PyObject *__pyx_v_kernel = NULL;
-  PyObject *__pyx_v_k_string = NULL;
-  PyObject *__pyx_v_mean = NULL;
+  PyObject *__pyx_v_smu = NULL;
+  PyObject *__pyx_v_kname = NULL;
+  PyObject *__pyx_v_mname = NULL;
+  PyObject *__pyx_v_cname = NULL;
   bopt_params __pyx_r;
   __Pyx_RefNannyDeclarations
   PyObject *__pyx_t_1 = NULL;
   PyObject *__pyx_t_2 = NULL;
   unsigned int __pyx_t_3;
   char *__pyx_t_4;
-  double __pyx_t_5;
-  int __pyx_t_6;
-  Py_ssize_t __pyx_t_7;
-  long __pyx_t_8;
+  int __pyx_t_5;
+  double __pyx_t_6;
+  int __pyx_t_7;
+  int __pyx_t_8;
+  Py_ssize_t __pyx_t_9;
+  long __pyx_t_10;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("dict2structparams", 0);
 
-  /* "bayesopt.pyx":91
+  /* "bayesopt.pyx":98
  * cdef bopt_params dict2structparams(dict dparams):
  * 
  *     params = initialize_parameters_to_default()             # <<<<<<<<<<<<<<
  */
   __pyx_v_params = initialize_parameters_to_default();
 
-  /* "bayesopt.pyx":93
+  /* "bayesopt.pyx":100
  *     params = initialize_parameters_to_default()
  * 
  *     params.n_iterations = dparams.get('n_iterations',params.n_iterations)             # <<<<<<<<<<<<<<
  *     params.verbose_level = dparams.get('verbose_level',params.verbose_level)
  */
   if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
   }
-  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_params.n_iterations); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_params.n_iterations); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__n_iterations), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__n_iterations), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_v_params.n_iterations = __pyx_t_3;
 
-  /* "bayesopt.pyx":94
+  /* "bayesopt.pyx":101
  * 
  *     params.n_iterations = dparams.get('n_iterations',params.n_iterations)
  *     params.n_init_samples = dparams.get('n_init_samples',params.n_init_samples)             # <<<<<<<<<<<<<<
  * 
  */
   if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
   }
-  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_params.n_init_samples); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_params.n_init_samples); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__n_init_samples), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__n_init_samples), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_params.n_init_samples = __pyx_t_3;
 
-  /* "bayesopt.pyx":95
+  /* "bayesopt.pyx":102
  *     params.n_iterations = dparams.get('n_iterations',params.n_iterations)
  *     params.n_init_samples = dparams.get('n_init_samples',params.n_init_samples)
  *     params.verbose_level = dparams.get('verbose_level',params.verbose_level)             # <<<<<<<<<<<<<<
  *     logname = dparams.get('log_filename',params.log_filename)
  */
   if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
   }
-  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_params.verbose_level); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_params.verbose_level); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__verbose_level), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__verbose_level), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_v_params.verbose_level = __pyx_t_3;
 
-  /* "bayesopt.pyx":97
+  /* "bayesopt.pyx":104
  *     params.verbose_level = dparams.get('verbose_level',params.verbose_level)
  * 
  *     logname = dparams.get('log_filename',params.log_filename)             # <<<<<<<<<<<<<<
  * 
  */
   if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
   }
-  __pyx_t_2 = PyBytes_FromString(__pyx_v_params.log_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyBytes_FromString(__pyx_v_params.log_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__log_filename), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__log_filename), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
   __pyx_v_logname = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "bayesopt.pyx":98
+  /* "bayesopt.pyx":105
  * 
  *     logname = dparams.get('log_filename',params.log_filename)
  *     params.log_filename = logname             # <<<<<<<<<<<<<<
  * 
+ *     surrogate = dparams.get('s_name', None)
+ */
+  __pyx_t_4 = PyBytes_AsString(__pyx_v_logname); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_v_params.log_filename = __pyx_t_4;
+
+  /* "bayesopt.pyx":107
+ *     params.log_filename = logname
+ * 
+ *     surrogate = dparams.get('s_name', None)             # <<<<<<<<<<<<<<
+ *     if surrogate is not None:
+ *         params.surr_name = str2surrogate(surrogate)
+ */
+  if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
+  }
+  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__s_name), Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_v_surrogate = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+  /* "bayesopt.pyx":108
+ * 
+ *     surrogate = dparams.get('s_name', None)
+ *     if surrogate is not None:             # <<<<<<<<<<<<<<
+ *         params.surr_name = str2surrogate(surrogate)
+ * 
+ */
+  __pyx_t_5 = (__pyx_v_surrogate != Py_None);
+  if (__pyx_t_5) {
+
+    /* "bayesopt.pyx":109
+ *     surrogate = dparams.get('s_name', None)
+ *     if surrogate is not None:
+ *         params.surr_name = str2surrogate(surrogate)             # <<<<<<<<<<<<<<
+ * 
  *     params.alpha = dparams.get('alpha',params.alpha)
  */
-  __pyx_t_4 = PyBytes_AsString(__pyx_v_logname); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_params.log_filename = __pyx_t_4;
-
-  /* "bayesopt.pyx":100
- *     params.log_filename = logname
- * 
- *     params.alpha = dparams.get('alpha',params.alpha)             # <<<<<<<<<<<<<<
- *     params.beta = dparams.get('beta',params.beta)
- *     params.delta = dparams.get('delta',params.delta)
- */
-  if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
-  }
-  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_params.alpha); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__alpha), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_v_params.alpha = __pyx_t_5;
-
-  /* "bayesopt.pyx":101
- * 
- *     params.alpha = dparams.get('alpha',params.alpha)
- *     params.beta = dparams.get('beta',params.beta)             # <<<<<<<<<<<<<<
- *     params.delta = dparams.get('delta',params.delta)
- *     params.noise = dparams.get('noise',params.noise)
- */
-  if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
-  }
-  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_params.beta); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__beta), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_params.beta = __pyx_t_5;
-
-  /* "bayesopt.pyx":102
- *     params.alpha = dparams.get('alpha',params.alpha)
- *     params.beta = dparams.get('beta',params.beta)
- *     params.delta = dparams.get('delta',params.delta)             # <<<<<<<<<<<<<<
- *     params.noise = dparams.get('noise',params.noise)
- * 
- */
-  if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
-  }
-  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_params.delta); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__delta), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_v_params.delta = __pyx_t_5;
-
-  /* "bayesopt.pyx":103
- *     params.beta = dparams.get('beta',params.beta)
- *     params.delta = dparams.get('delta',params.delta)
- *     params.noise = dparams.get('noise',params.noise)             # <<<<<<<<<<<<<<
- * 
- *     theta = dparams.get('theta',None)
- */
-  if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
-  }
-  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_params.noise); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__noise), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_params.noise = __pyx_t_5;
-
-  /* "bayesopt.pyx":105
- *     params.noise = dparams.get('noise',params.noise)
- * 
- *     theta = dparams.get('theta',None)             # <<<<<<<<<<<<<<
- *     if theta is not None:
- *         params.n_theta = len(theta)
- */
-  if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
-  }
-  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__theta), Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_theta = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "bayesopt.pyx":106
- * 
- *     theta = dparams.get('theta',None)
- *     if theta is not None:             # <<<<<<<<<<<<<<
- *         params.n_theta = len(theta)
- *         for i in range(0,params.n_theta):
- */
-  __pyx_t_6 = (__pyx_v_theta != Py_None);
-  if (__pyx_t_6) {
-
-    /* "bayesopt.pyx":107
- *     theta = dparams.get('theta',None)
- *     if theta is not None:
- *         params.n_theta = len(theta)             # <<<<<<<<<<<<<<
- *         for i in range(0,params.n_theta):
- *             params.theta[i] = theta[i]
- */
-    __pyx_t_7 = PyObject_Length(__pyx_v_theta); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_params.n_theta = __pyx_t_7;
-
-    /* "bayesopt.pyx":108
- *     if theta is not None:
- *         params.n_theta = len(theta)
- *         for i in range(0,params.n_theta):             # <<<<<<<<<<<<<<
- *             params.theta[i] = theta[i]
- * 
- */
-    __pyx_t_3 = __pyx_v_params.n_theta;
-    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_3; __pyx_t_8+=1) {
-      __pyx_v_i = __pyx_t_8;
-
-      /* "bayesopt.pyx":109
- *         params.n_theta = len(theta)
- *         for i in range(0,params.n_theta):
- *             params.theta[i] = theta[i]             # <<<<<<<<<<<<<<
- * 
- *     mu = dparams.get('mu',None)
- */
-      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_theta, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      (__pyx_v_params.theta[__pyx_v_i]) = __pyx_t_5;
-    }
+    __pyx_t_4 = PyBytes_AsString(__pyx_v_surrogate); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_params.surr_name = str2surrogate(__pyx_t_4);
     goto __pyx_L3;
   }
   __pyx_L3:;
 
   /* "bayesopt.pyx":111
- *             params.theta[i] = theta[i]
- * 
- *     mu = dparams.get('mu',None)             # <<<<<<<<<<<<<<
- *     if mu is not None:
- *         params.n_mu = len(mu)
+ *         params.surr_name = str2surrogate(surrogate)
+ * 
+ *     params.alpha = dparams.get('alpha',params.alpha)             # <<<<<<<<<<<<<<
+ *     params.beta = dparams.get('beta',params.beta)
+ *     params.noise = dparams.get('noise',params.noise)
  */
   if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
   }
-  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__mu), Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_params.alpha); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_mu = __pyx_t_1;
-  __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__alpha), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_params.alpha = __pyx_t_6;
 
   /* "bayesopt.pyx":112
  * 
+ *     params.alpha = dparams.get('alpha',params.alpha)
+ *     params.beta = dparams.get('beta',params.beta)             # <<<<<<<<<<<<<<
+ *     params.noise = dparams.get('noise',params.noise)
+ * 
+ */
+  if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
+  }
+  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_params.beta); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__beta), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_v_params.beta = __pyx_t_6;
+
+  /* "bayesopt.pyx":113
+ *     params.alpha = dparams.get('alpha',params.alpha)
+ *     params.beta = dparams.get('beta',params.beta)
+ *     params.noise = dparams.get('noise',params.noise)             # <<<<<<<<<<<<<<
+ * 
+ *     theta = dparams.get('theta',None)
+ */
+  if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
+  }
+  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_params.noise); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__noise), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_v_params.noise = __pyx_t_6;
+
+  /* "bayesopt.pyx":115
+ *     params.noise = dparams.get('noise',params.noise)
+ * 
+ *     theta = dparams.get('theta',None)             # <<<<<<<<<<<<<<
+ *     stheta = dparams.get('s_theta',None)
+ *     if theta is not None and stheta is not None:
+ */
+  if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
+  }
+  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__theta), Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_v_theta = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+  /* "bayesopt.pyx":116
+ * 
+ *     theta = dparams.get('theta',None)
+ *     stheta = dparams.get('s_theta',None)             # <<<<<<<<<<<<<<
+ *     if theta is not None and stheta is not None:
+ *         params.kernel.n_theta = len(theta)
+ */
+  if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
+  }
+  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__s_theta), Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_v_stheta = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+  /* "bayesopt.pyx":117
+ *     theta = dparams.get('theta',None)
+ *     stheta = dparams.get('s_theta',None)
+ *     if theta is not None and stheta is not None:             # <<<<<<<<<<<<<<
+ *         params.kernel.n_theta = len(theta)
+ *         for i in range(0,params.kernel.n_theta):
+ */
+  __pyx_t_5 = (__pyx_v_theta != Py_None);
+  if (__pyx_t_5) {
+    __pyx_t_7 = (__pyx_v_stheta != Py_None);
+    __pyx_t_8 = __pyx_t_7;
+  } else {
+    __pyx_t_8 = __pyx_t_5;
+  }
+  if (__pyx_t_8) {
+
+    /* "bayesopt.pyx":118
+ *     stheta = dparams.get('s_theta',None)
+ *     if theta is not None and stheta is not None:
+ *         params.kernel.n_theta = len(theta)             # <<<<<<<<<<<<<<
+ *         for i in range(0,params.kernel.n_theta):
+ *             params.kernel.theta[i] = theta[i]
+ */
+    __pyx_t_9 = PyObject_Length(__pyx_v_theta); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_params.kernel.n_theta = __pyx_t_9;
+
+    /* "bayesopt.pyx":119
+ *     if theta is not None and stheta is not None:
+ *         params.kernel.n_theta = len(theta)
+ *         for i in range(0,params.kernel.n_theta):             # <<<<<<<<<<<<<<
+ *             params.kernel.theta[i] = theta[i]
+ *             params.kernel.s_theta[i] = stheta[i]
+ */
+    __pyx_t_3 = __pyx_v_params.kernel.n_theta;
+    for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_3; __pyx_t_10+=1) {
+      __pyx_v_i = __pyx_t_10;
+
+      /* "bayesopt.pyx":120
+ *         params.kernel.n_theta = len(theta)
+ *         for i in range(0,params.kernel.n_theta):
+ *             params.kernel.theta[i] = theta[i]             # <<<<<<<<<<<<<<
+ *             params.kernel.s_theta[i] = stheta[i]
+ * 
+ */
+      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_theta, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      (__pyx_v_params.kernel.theta[__pyx_v_i]) = __pyx_t_6;
+
+      /* "bayesopt.pyx":121
+ *         for i in range(0,params.kernel.n_theta):
+ *             params.kernel.theta[i] = theta[i]
+ *             params.kernel.s_theta[i] = stheta[i]             # <<<<<<<<<<<<<<
+ * 
+ * 
+ */
+      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_stheta, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      (__pyx_v_params.kernel.s_theta[__pyx_v_i]) = __pyx_t_6;
+    }
+    goto __pyx_L4;
+  }
+  __pyx_L4:;
+
+  /* "bayesopt.pyx":124
+ * 
+ * 
+ *     mu = dparams.get('mu',None)             # <<<<<<<<<<<<<<
+ *     smu = dparams.get('mu',None)
+ *     if mu is not None and smu is not None:
+ */
+  if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
+  }
+  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__mu), Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_v_mu = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+  /* "bayesopt.pyx":125
+ * 
  *     mu = dparams.get('mu',None)
- *     if mu is not None:             # <<<<<<<<<<<<<<
- *         params.n_mu = len(mu)
- *         for i in range(0,params.n_mu):
- */
-  __pyx_t_6 = (__pyx_v_mu != Py_None);
-  if (__pyx_t_6) {
-
-    /* "bayesopt.pyx":113
- *     mu = dparams.get('mu',None)
- *     if mu is not None:
- *         params.n_mu = len(mu)             # <<<<<<<<<<<<<<
- *         for i in range(0,params.n_mu):
- *             params.mu[i] = mu[i]
- */
-    __pyx_t_7 = PyObject_Length(__pyx_v_mu); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_params.n_mu = __pyx_t_7;
-
-    /* "bayesopt.pyx":114
- *     if mu is not None:
- *         params.n_mu = len(mu)
- *         for i in range(0,params.n_mu):             # <<<<<<<<<<<<<<
- *             params.mu[i] = mu[i]
- * 
- */
-    __pyx_t_3 = __pyx_v_params.n_mu;
-    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_3; __pyx_t_8+=1) {
-      __pyx_v_i = __pyx_t_8;
-
-      /* "bayesopt.pyx":115
- *         params.n_mu = len(mu)
- *         for i in range(0,params.n_mu):
- *             params.mu[i] = mu[i]             # <<<<<<<<<<<<<<
- * 
- *     criteria = dparams.get('c_name',None)
- */
-      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_mu, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      (__pyx_v_params.mu[__pyx_v_i]) = __pyx_t_5;
-    }
-    goto __pyx_L6;
-  }
-  __pyx_L6:;
-
-  /* "bayesopt.pyx":117
- *             params.mu[i] = mu[i]
- * 
- *     criteria = dparams.get('c_name',None)             # <<<<<<<<<<<<<<
- *     if criteria is not None:
- *         params.c_name = str2crit(criteria)
- */
-  if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
-  }
-  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__c_name), Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_criteria = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "bayesopt.pyx":118
- * 
- *     criteria = dparams.get('c_name',None)
- *     if criteria is not None:             # <<<<<<<<<<<<<<
- *         params.c_name = str2crit(criteria)
- * 
- */
-  __pyx_t_6 = (__pyx_v_criteria != Py_None);
-  if (__pyx_t_6) {
-
-    /* "bayesopt.pyx":119
- *     criteria = dparams.get('c_name',None)
- *     if criteria is not None:
- *         params.c_name = str2crit(criteria)             # <<<<<<<<<<<<<<
- * 
- *     surrogate = dparams.get('s_name', None)
- */
-    __pyx_t_4 = PyBytes_AsString(__pyx_v_criteria); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_params.c_name = str2crit(__pyx_t_4);
-    goto __pyx_L9;
-  }
-  __pyx_L9:;
-
-  /* "bayesopt.pyx":121
- *         params.c_name = str2crit(criteria)
- * 
- *     surrogate = dparams.get('s_name', None)             # <<<<<<<<<<<<<<
- *     if criteria is not None:
- *         params.s_name = str2surrogate(surrogate)
- */
-  if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
-  }
-  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__s_name), Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_surrogate = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "bayesopt.pyx":122
- * 
- *     surrogate = dparams.get('s_name', None)
- *     if criteria is not None:             # <<<<<<<<<<<<<<
- *         params.s_name = str2surrogate(surrogate)
- * 
- */
-  __pyx_t_6 = (__pyx_v_criteria != Py_None);
-  if (__pyx_t_6) {
-
-    /* "bayesopt.pyx":123
- *     surrogate = dparams.get('s_name', None)
- *     if criteria is not None:
- *         params.s_name = str2surrogate(surrogate)             # <<<<<<<<<<<<<<
- * 
- *     kernel = dparams.get('k_name',None)
- */
-    __pyx_t_4 = PyBytes_AsString(__pyx_v_surrogate); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_params.s_name = str2surrogate(__pyx_t_4);
-    goto __pyx_L10;
-  }
-  __pyx_L10:;
-
-  /* "bayesopt.pyx":125
- *         params.s_name = str2surrogate(surrogate)
- * 
- *     kernel = dparams.get('k_name',None)             # <<<<<<<<<<<<<<
- *     if kernel is not None:
- *         params.k_name = str2kernel(kernel)
+ *     smu = dparams.get('mu',None)             # <<<<<<<<<<<<<<
+ *     if mu is not None and smu is not None:
+ *         params.mean.n_mu = len(mu)
  */
   if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
   }
-  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__k_name), Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__mu), Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_v_smu = __pyx_t_2;
+  __pyx_t_2 = 0;
+
+  /* "bayesopt.pyx":126
+ *     mu = dparams.get('mu',None)
+ *     smu = dparams.get('mu',None)
+ *     if mu is not None and smu is not None:             # <<<<<<<<<<<<<<
+ *         params.mean.n_mu = len(mu)
+ *         for i in range(0,params.mean.n_mu):
+ */
+  __pyx_t_8 = (__pyx_v_mu != Py_None);
+  if (__pyx_t_8) {
+    __pyx_t_5 = (__pyx_v_smu != Py_None);
+    __pyx_t_7 = __pyx_t_5;
+  } else {
+    __pyx_t_7 = __pyx_t_8;
+  }
+  if (__pyx_t_7) {
+
+    /* "bayesopt.pyx":127
+ *     smu = dparams.get('mu',None)
+ *     if mu is not None and smu is not None:
+ *         params.mean.n_mu = len(mu)             # <<<<<<<<<<<<<<
+ *         for i in range(0,params.mean.n_mu):
+ *             params.mean.mu[i] = mu[i]
+ */
+    __pyx_t_9 = PyObject_Length(__pyx_v_mu); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_params.mean.n_mu = __pyx_t_9;
+
+    /* "bayesopt.pyx":128
+ *     if mu is not None and smu is not None:
+ *         params.mean.n_mu = len(mu)
+ *         for i in range(0,params.mean.n_mu):             # <<<<<<<<<<<<<<
+ *             params.mean.mu[i] = mu[i]
+ *             params.mean.s_mu[i] = smu[i]
+ */
+    __pyx_t_3 = __pyx_v_params.mean.n_mu;
+    for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_3; __pyx_t_10+=1) {
+      __pyx_v_i = __pyx_t_10;
+
+      /* "bayesopt.pyx":129
+ *         params.mean.n_mu = len(mu)
+ *         for i in range(0,params.mean.n_mu):
+ *             params.mean.mu[i] = mu[i]             # <<<<<<<<<<<<<<
+ *             params.mean.s_mu[i] = smu[i]
+ * 
+ */
+      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_mu, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      (__pyx_v_params.mean.mu[__pyx_v_i]) = __pyx_t_6;
+
+      /* "bayesopt.pyx":130
+ *         for i in range(0,params.mean.n_mu):
+ *             params.mean.mu[i] = mu[i]
+ *             params.mean.s_mu[i] = smu[i]             # <<<<<<<<<<<<<<
+ * 
+ * 
+ */
+      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_smu, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_GOTREF(__pyx_t_2);
+      __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      (__pyx_v_params.mean.s_mu[__pyx_v_i]) = __pyx_t_6;
+    }
+    goto __pyx_L7;
+  }
+  __pyx_L7:;
+
+  /* "bayesopt.pyx":133
+ * 
+ * 
+ *     kname = dparams.get('k_name',params.kernel.name)             # <<<<<<<<<<<<<<
+ *     params.kernel.name = kname;
+ * 
+ */
+  if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
+  }
+  __pyx_t_2 = PyBytes_FromString(__pyx_v_params.kernel.name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__k_name), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_kernel = __pyx_t_1;
+  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __pyx_v_kname = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "bayesopt.pyx":126
- * 
- *     kernel = dparams.get('k_name',None)
- *     if kernel is not None:             # <<<<<<<<<<<<<<
- *         params.k_name = str2kernel(kernel)
- * 
- */
-  __pyx_t_6 = (__pyx_v_kernel != Py_None);
-  if (__pyx_t_6) {
-
-    /* "bayesopt.pyx":127
- *     kernel = dparams.get('k_name',None)
- *     if kernel is not None:
- *         params.k_name = str2kernel(kernel)             # <<<<<<<<<<<<<<
- * 
- *     k_string = dparams.get('k_s_name',params.log_filename)
- */
-    __pyx_t_4 = PyBytes_AsString(__pyx_v_kernel); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_params.k_name = str2kernel(__pyx_t_4);
-    goto __pyx_L11;
+  /* "bayesopt.pyx":134
+ * 
+ *     kname = dparams.get('k_name',params.kernel.name)
+ *     params.kernel.name = kname;             # <<<<<<<<<<<<<<
+ * 
+ *     mname = dparams.get('m_name',params.mean.name)
+ */
+  __pyx_t_4 = PyBytes_AsString(__pyx_v_kname); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_v_params.kernel.name = __pyx_t_4;
+
+  /* "bayesopt.pyx":136
+ *     params.kernel.name = kname;
+ * 
+ *     mname = dparams.get('m_name',params.mean.name)             # <<<<<<<<<<<<<<
+ *     params.mean.name = mname
+ * 
+ */
+  if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
   }
-  __pyx_L11:;
-
-  /* "bayesopt.pyx":129
- *         params.k_name = str2kernel(kernel)
- * 
- *     k_string = dparams.get('k_s_name',params.log_filename)             # <<<<<<<<<<<<<<
- *     params.k_s_name = k_string
- * 
- */
-  if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
-  }
-  __pyx_t_1 = PyBytes_FromString(__pyx_v_params.log_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyBytes_FromString(__pyx_v_params.mean.name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__k_s_name), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__m_name), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-  __pyx_v_k_string = __pyx_t_2;
+  __pyx_v_mname = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "bayesopt.pyx":130
- * 
- *     k_string = dparams.get('k_s_name',params.log_filename)
- *     params.k_s_name = k_string             # <<<<<<<<<<<<<<
- * 
- *     mean = dparams.get('m_name',None)
- */
-  __pyx_t_4 = PyBytes_AsString(__pyx_v_k_string); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_params.k_s_name = __pyx_t_4;
-
-  /* "bayesopt.pyx":132
- *     params.k_s_name = k_string
- * 
- *     mean = dparams.get('m_name',None)             # <<<<<<<<<<<<<<
- *     if mean is not None:
- *         params.m_name = str2mean(mean)
+  /* "bayesopt.pyx":137
+ * 
+ *     mname = dparams.get('m_name',params.mean.name)
+ *     params.mean.name = mname             # <<<<<<<<<<<<<<
+ * 
+ *     cname = dparams.get('c_name',params.crit_name)
+ */
+  __pyx_t_4 = PyBytes_AsString(__pyx_v_mname); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_v_params.mean.name = __pyx_t_4;
+
+  /* "bayesopt.pyx":139
+ *     params.mean.name = mname
+ * 
+ *     cname = dparams.get('c_name',params.crit_name)             # <<<<<<<<<<<<<<
+ *     params.crit_name = cname
+ * 
  */
   if (unlikely(((PyObject *)__pyx_v_dparams) == Py_None)) {
-    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
+    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
   }
-  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__m_name), Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_v_mean = __pyx_t_2;
-  __pyx_t_2 = 0;
-
-  /* "bayesopt.pyx":133
- * 
- *     mean = dparams.get('m_name',None)
- *     if mean is not None:             # <<<<<<<<<<<<<<
- *         params.m_name = str2mean(mean)
- * 
- */
-  __pyx_t_6 = (__pyx_v_mean != Py_None);
-  if (__pyx_t_6) {
-
-    /* "bayesopt.pyx":134
- *     mean = dparams.get('m_name',None)
- *     if mean is not None:
- *         params.m_name = str2mean(mean)             # <<<<<<<<<<<<<<
+  __pyx_t_2 = PyBytes_FromString(__pyx_v_params.crit_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_dparams), ((PyObject *)__pyx_n_s__c_name), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __pyx_v_cname = __pyx_t_1;
+  __pyx_t_1 = 0;
+
+  /* "bayesopt.pyx":140
+ * 
+ *     cname = dparams.get('c_name',params.crit_name)
+ *     params.crit_name = cname             # <<<<<<<<<<<<<<
  * 
  *     return params
  */
-    __pyx_t_4 = PyBytes_AsString(__pyx_v_mean); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_params.m_name = str2mean(__pyx_t_4);
-    goto __pyx_L12;
-  }
-  __pyx_L12:;
-
-  /* "bayesopt.pyx":136
- *         params.m_name = str2mean(mean)
+  __pyx_t_4 = PyBytes_AsString(__pyx_v_cname); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_v_params.crit_name = __pyx_t_4;
+
+  /* "bayesopt.pyx":142
+ *     params.crit_name = cname
  * 
  *     return params             # <<<<<<<<<<<<<<
  * 
   __Pyx_WriteUnraisable("bayesopt.dict2structparams", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
   __Pyx_XDECREF(__pyx_v_logname);
+  __Pyx_XDECREF(__pyx_v_surrogate);
   __Pyx_XDECREF(__pyx_v_theta);
+  __Pyx_XDECREF(__pyx_v_stheta);
   __Pyx_XDECREF(__pyx_v_mu);
-  __Pyx_XDECREF(__pyx_v_criteria);
-  __Pyx_XDECREF(__pyx_v_surrogate);
-  __Pyx_XDECREF(__pyx_v_kernel);
-  __Pyx_XDECREF(__pyx_v_k_string);
-  __Pyx_XDECREF(__pyx_v_mean);
+  __Pyx_XDECREF(__pyx_v_smu);
+  __Pyx_XDECREF(__pyx_v_kname);
+  __Pyx_XDECREF(__pyx_v_mname);
+  __Pyx_XDECREF(__pyx_v_cname);
   __Pyx_RefNannyFinishContext();
   return __pyx_r;
 }
 
-/* "bayesopt.pyx":138
+/* "bayesopt.pyx":144
  *     return params
  * 
  * cdef double callback(unsigned int n, const_double_ptr x,             # <<<<<<<<<<<<<<
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("callback", 0);
 
-  /* "bayesopt.pyx":140
+  /* "bayesopt.pyx":146
  * cdef double callback(unsigned int n, const_double_ptr x,
  *                      double *gradient, void *func_data):
  *     x_np = np.zeros(n)             # <<<<<<<<<<<<<<
  *     for i in range(0,n):
  *         x_np[i] = <double>x[i]
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
-  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
   __pyx_v_x_np = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "bayesopt.pyx":141
+  /* "bayesopt.pyx":147
  *                      double *gradient, void *func_data):
  *     x_np = np.zeros(n)
  *     for i in range(0,n):             # <<<<<<<<<<<<<<
   for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
     __pyx_v_i = __pyx_t_5;
 
-    /* "bayesopt.pyx":142
+    /* "bayesopt.pyx":148
  *     x_np = np.zeros(n)
  *     for i in range(0,n):
  *         x_np[i] = <double>x[i]             # <<<<<<<<<<<<<<
  *         result = (<object>func_data)(x_np)
  *     return result
  */
-    __pyx_t_1 = PyFloat_FromDouble(((double)(__pyx_v_x[__pyx_v_i]))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyFloat_FromDouble(((double)(__pyx_v_x[__pyx_v_i]))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
-    if (__Pyx_SetItemInt(__pyx_v_x_np, __pyx_v_i, __pyx_t_1, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (__Pyx_SetItemInt(__pyx_v_x_np, __pyx_v_i, __pyx_t_1, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "bayesopt.pyx":143
+    /* "bayesopt.pyx":149
  *     for i in range(0,n):
  *         x_np[i] = <double>x[i]
  *         result = (<object>func_data)(x_np)             # <<<<<<<<<<<<<<
  *     return result
  * 
  */
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_INCREF(__pyx_v_x_np);
     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x_np);
     __Pyx_GIVEREF(__pyx_v_x_np);
-    __pyx_t_3 = PyObject_Call(((PyObject *)__pyx_v_func_data), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_t_3 = PyObject_Call(((PyObject *)__pyx_v_func_data), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
     __Pyx_XDECREF(__pyx_v_result);
     __pyx_t_3 = 0;
   }
 
-  /* "bayesopt.pyx":144
+  /* "bayesopt.pyx":150
  *         x_np[i] = <double>x[i]
  *         result = (<object>func_data)(x_np)
  *     return result             # <<<<<<<<<<<<<<
  * 
  * 
  */
-  if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_result); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_result); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_t_6;
   goto __pyx_L0;
 
   return __pyx_r;
 }
 
-/* "bayesopt.pyx":147
+/* "bayesopt.pyx":153
  * 
  * 
  * def initialize_params():             # <<<<<<<<<<<<<<
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("initialize_params", 0);
 
-  /* "bayesopt.pyx":148
+  /* "bayesopt.pyx":154
  * 
  * def initialize_params():
  *     params = {             # <<<<<<<<<<<<<<
  *         "theta"  : [1.0],
  *         "n_theta": 1,
  */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
-  /* "bayesopt.pyx":149
+  /* "bayesopt.pyx":155
  * def initialize_params():
  *     params = {
  *         "theta"  : [1.0],             # <<<<<<<<<<<<<<
  *         "n_theta": 1,
  *         "mu"     : [1.0],
  */
-  __pyx_t_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__theta), ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__theta), ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__n_theta), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "bayesopt.pyx":151
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__n_theta), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "bayesopt.pyx":157
  *         "theta"  : [1.0],
  *         "n_theta": 1,
  *         "mu"     : [1.0],             # <<<<<<<<<<<<<<
  *         "n_mu"   : 1,
  *         "alpha"  : 1.0,
  */
-  __pyx_t_3 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
   __Pyx_GIVEREF(__pyx_t_3);
   __pyx_t_3 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__mu), ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__mu), ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__n_mu), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "bayesopt.pyx":153
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__n_mu), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  /* "bayesopt.pyx":159
  *         "mu"     : [1.0],
  *         "n_mu"   : 1,
  *         "alpha"  : 1.0,             # <<<<<<<<<<<<<<
  *         "beta"   : 1.0,
  *         "delta"  : 1000.0,
  */
-  __pyx_t_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__alpha), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__alpha), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "bayesopt.pyx":154
+  /* "bayesopt.pyx":160
  *         "n_mu"   : 1,
  *         "alpha"  : 1.0,
  *         "beta"   : 1.0,             # <<<<<<<<<<<<<<
  *         "delta"  : 1000.0,
  *         "noise"  : 0.001,
  */
-  __pyx_t_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__beta), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__beta), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "bayesopt.pyx":155
+  /* "bayesopt.pyx":161
  *         "alpha"  : 1.0,
  *         "beta"   : 1.0,
  *         "delta"  : 1000.0,             # <<<<<<<<<<<<<<
  *         "noise"  : 0.001,
  *         "c_name" : "EI",
  */
-  __pyx_t_2 = PyFloat_FromDouble(1000.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyFloat_FromDouble(1000.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__delta), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__delta), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "bayesopt.pyx":156
+  /* "bayesopt.pyx":162
  *         "beta"   : 1.0,
  *         "delta"  : 1000.0,
  *         "noise"  : 0.001,             # <<<<<<<<<<<<<<
  *         "c_name" : "EI",
  *         "s_name" : "GAUSSIAN_PROCESS" ,
  */
-  __pyx_t_2 = PyFloat_FromDouble(0.001); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyFloat_FromDouble(0.001); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__noise), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__noise), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__c_name), ((PyObject *)__pyx_n_s__EI)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__s_name), ((PyObject *)__pyx_n_s__GAUSSIAN_PROCESS)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__k_name), ((PyObject *)__pyx_n_s__MATERN_ISO3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__m_name), ((PyObject *)__pyx_n_s__ZERO)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__n_iterations), __pyx_int_300) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__n_init_samples), __pyx_int_30) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__verbose_level), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__log_filename), ((PyObject *)__pyx_kp_s_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__c_name), ((PyObject *)__pyx_n_s__EI)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__s_name), ((PyObject *)__pyx_n_s__GAUSSIAN_PROCESS)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__k_name), ((PyObject *)__pyx_n_s__MATERN_ISO3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__m_name), ((PyObject *)__pyx_n_s__ZERO)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__n_iterations), __pyx_int_300) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__n_init_samples), __pyx_int_30) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__verbose_level), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__log_filename), ((PyObject *)__pyx_kp_s_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_params = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "bayesopt.pyx":166
+  /* "bayesopt.pyx":172
  *         "log_filename"   : "bayesopt.log"
  *         }
  *     return params             # <<<<<<<<<<<<<<
         values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nDim);
         if (likely(values[1])) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("optimize", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("optimize", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
         values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__np_lb);
         if (likely(values[2])) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("optimize", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("optimize", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  3:
         values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__np_ub);
         if (likely(values[3])) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("optimize", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("optimize", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  4:
         values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dparams);
         if (likely(values[4])) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("optimize", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("optimize", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "optimize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "optimize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
       goto __pyx_L5_argtuple_error;
       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
     }
     __pyx_v_f = values[0];
-    __pyx_v_nDim = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_nDim == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_nDim = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_nDim == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
     __pyx_v_np_lb = ((PyArrayObject *)values[2]);
     __pyx_v_np_ub = ((PyArrayObject *)values[3]);
     __pyx_v_dparams = ((PyObject*)values[4]);
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("optimize", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("optimize", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bayesopt.optimize", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_np_lb), __pyx_ptype_5numpy_ndarray, 1, "np_lb", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_np_ub), __pyx_ptype_5numpy_ndarray, 1, "np_ub", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dparams), (&PyDict_Type), 1, "dparams", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_np_lb), __pyx_ptype_5numpy_ndarray, 1, "np_lb", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_np_ub), __pyx_ptype_5numpy_ndarray, 1, "np_ub", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dparams), (&PyDict_Type), 1, "dparams", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_8bayesopt_2optimize(__pyx_self, __pyx_v_f, __pyx_v_nDim, __pyx_v_np_lb, __pyx_v_np_ub, __pyx_v_dparams);
   goto __pyx_L0;
   __pyx_L1_error:;
   return __pyx_r;
 }
 
-/* "bayesopt.pyx":168
+/* "bayesopt.pyx":174
  *     return params
  * 
  * def optimize(f, int nDim, np.ndarray[np.double_t] np_lb,             # <<<<<<<<<<<<<<
   __pyx_pybuffernd_np_ub.rcbuffer = &__pyx_pybuffer_np_ub;
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_np_lb.rcbuffer->pybuffer, (PyObject*)__pyx_v_np_lb, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_np_lb.rcbuffer->pybuffer, (PyObject*)__pyx_v_np_lb, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_pybuffernd_np_lb.diminfo[0].strides = __pyx_pybuffernd_np_lb.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_np_lb.diminfo[0].shape = __pyx_pybuffernd_np_lb.rcbuffer->pybuffer.shape[0];
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_np_ub.rcbuffer->pybuffer, (PyObject*)__pyx_v_np_ub, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_np_ub.rcbuffer->pybuffer, (PyObject*)__pyx_v_np_ub, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_pybuffernd_np_ub.diminfo[0].strides = __pyx_pybuffernd_np_ub.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_np_ub.diminfo[0].shape = __pyx_pybuffernd_np_ub.rcbuffer->pybuffer.shape[0];
 
-  /* "bayesopt.pyx":171
+  /* "bayesopt.pyx":177
  *              np.ndarray[np.double_t] np_ub, dict dparams):
  * 
  *     cdef bopt_params params = dict2structparams(dparams)             # <<<<<<<<<<<<<<
  */
   __pyx_v_params = __pyx_f_8bayesopt_dict2structparams(__pyx_v_dparams);
 
-  /* "bayesopt.pyx":173
+  /* "bayesopt.pyx":179
  *     cdef bopt_params params = dict2structparams(dparams)
  *     cdef double minf[1000]
  *     cdef np.ndarray np_x = np.zeros([nDim], dtype=np.double)             # <<<<<<<<<<<<<<
  * 
  *     cdef np.ndarray[np.double_t, ndim=1, mode="c"] lb
  */
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyInt_FromLong(__pyx_v_nDim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyInt_FromLong(__pyx_v_nDim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_t_1 = 0;
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
   __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
   __pyx_t_3 = 0;
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_v_np_x = ((PyArrayObject *)__pyx_t_5);
   __pyx_t_5 = 0;
 
-  /* "bayesopt.pyx":179
+  /* "bayesopt.pyx":185
  *     cdef np.ndarray[np.double_t, ndim=1, mode="c"] x
  * 
  *     lb = np.ascontiguousarray(np_lb,dtype=np.double)             # <<<<<<<<<<<<<<
  *     ub = np.ascontiguousarray(np_ub,dtype=np.double)
  *     x  = np.ascontiguousarray(np_x,dtype=np.double)
  */
-  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(((PyObject *)__pyx_v_np_lb));
   PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_np_lb));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_np_lb));
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_6 = ((PyArrayObject *)__pyx_t_4);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
       }
     }
     __pyx_pybuffernd_lb.diminfo[0].strides = __pyx_pybuffernd_lb.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lb.diminfo[0].shape = __pyx_pybuffernd_lb.rcbuffer->pybuffer.shape[0];
-    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_t_6 = 0;
   __pyx_v_lb = ((PyArrayObject *)__pyx_t_4);
   __pyx_t_4 = 0;
 
-  /* "bayesopt.pyx":180
+  /* "bayesopt.pyx":186
  * 
  *     lb = np.ascontiguousarray(np_lb,dtype=np.double)
  *     ub = np.ascontiguousarray(np_ub,dtype=np.double)             # <<<<<<<<<<<<<<
  *     x  = np.ascontiguousarray(np_x,dtype=np.double)
  * 
  */
-  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_np_ub));
   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_np_ub));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_np_ub));
-  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_5));
-  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__double); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
-  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
       }
     }
     __pyx_pybuffernd_ub.diminfo[0].strides = __pyx_pybuffernd_ub.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ub.diminfo[0].shape = __pyx_pybuffernd_ub.rcbuffer->pybuffer.shape[0];
-    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_t_11 = 0;
   __pyx_v_ub = ((PyArrayObject *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "bayesopt.pyx":181
+  /* "bayesopt.pyx":187
  *     lb = np.ascontiguousarray(np_lb,dtype=np.double)
  *     ub = np.ascontiguousarray(np_ub,dtype=np.double)
  *     x  = np.ascontiguousarray(np_x,dtype=np.double)             # <<<<<<<<<<<<<<
  * 
  *     Py_INCREF(f)
  */
-  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(((PyObject *)__pyx_v_np_x));
   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_np_x));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_np_x));
-  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__double); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__double); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
-  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_t_12 = ((PyArrayObject *)__pyx_t_3);
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
       }
     }
     __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0];
-    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_t_12 = 0;
   __pyx_v_x = ((PyArrayObject *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "bayesopt.pyx":183
+  /* "bayesopt.pyx":189
  *     x  = np.ascontiguousarray(np_x,dtype=np.double)
  * 
  *     Py_INCREF(f)             # <<<<<<<<<<<<<<
  */
   Py_INCREF(__pyx_v_f);
 
-  /* "bayesopt.pyx":186
+  /* "bayesopt.pyx":192
  * 
  *     error_code = bayes_optimization(nDim, callback, <void *> f,
  *                                     &lb[0], &ub[0], &x[0], minf, params)             # <<<<<<<<<<<<<<
   } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_lb.diminfo[0].shape)) __pyx_t_7 = 0;
   if (unlikely(__pyx_t_7 != -1)) {
     __Pyx_RaiseBufferIndexError(__pyx_t_7);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_t_14 = 0;
   __pyx_t_7 = -1;
   } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_ub.diminfo[0].shape)) __pyx_t_7 = 0;
   if (unlikely(__pyx_t_7 != -1)) {
     __Pyx_RaiseBufferIndexError(__pyx_t_7);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_t_15 = 0;
   __pyx_t_7 = -1;
   } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_7 = 0;
   if (unlikely(__pyx_t_7 != -1)) {
     __Pyx_RaiseBufferIndexError(__pyx_t_7);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_v_error_code = bayes_optimization(__pyx_v_nDim, __pyx_f_8bayesopt_callback, ((void *)__pyx_v_f), (&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_lb.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_lb.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_ub.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_ub.diminfo[0].strides))), (&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_double_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_x.diminfo[0].strides))), __pyx_v_minf, __pyx_v_params);
 
-  /* "bayesopt.pyx":188
+  /* "bayesopt.pyx":194
  *                                     &lb[0], &ub[0], &x[0], minf, params)
  * 
  *     Py_DECREF(f)             # <<<<<<<<<<<<<<
  */
   Py_DECREF(__pyx_v_f);
 
-  /* "bayesopt.pyx":189
+  /* "bayesopt.pyx":195
  * 
  *     Py_DECREF(f)
  *     min_value = minf[0]             # <<<<<<<<<<<<<<
  */
   __pyx_v_min_value = (__pyx_v_minf[0]);
 
-  /* "bayesopt.pyx":190
+  /* "bayesopt.pyx":196
  *     Py_DECREF(f)
  *     min_value = minf[0]
  *     return min_value,np_x,error_code             # <<<<<<<<<<<<<<
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_min_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_min_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyInt_FromLong(__pyx_v_error_code); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_4 = PyInt_FromLong(__pyx_v_error_code); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __Pyx_GOTREF(__pyx_t_2);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
   __Pyx_GIVEREF(__pyx_t_3);
         values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__np_valid_x);
         if (likely(values[1])) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("optimize_discrete", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("optimize_discrete", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
         case  2:
         values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dparams);
         if (likely(values[2])) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("optimize_discrete", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+          __Pyx_RaiseArgtupleInvalid("optimize_discrete", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "optimize_discrete") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "optimize_discrete") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
       goto __pyx_L5_argtuple_error;
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("optimize_discrete", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __Pyx_RaiseArgtupleInvalid("optimize_discrete", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
   __pyx_L3_error:;
   __Pyx_AddTraceback("bayesopt.optimize_discrete", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_np_valid_x), __pyx_ptype_5numpy_ndarray, 1, "np_valid_x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dparams), (&PyDict_Type), 1, "dparams", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_np_valid_x), __pyx_ptype_5numpy_ndarray, 1, "np_valid_x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dparams), (&PyDict_Type), 1, "dparams", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   __pyx_r = __pyx_pf_8bayesopt_4optimize_discrete(__pyx_self, __pyx_v_f, __pyx_v_np_valid_x, __pyx_v_dparams);
   goto __pyx_L0;
   __pyx_L1_error:;
   return __pyx_r;
 }
 
-/* "bayesopt.pyx":193
+/* "bayesopt.pyx":199
  * 
  * 
  * def optimize_discrete(f, np.ndarray[np.double_t,ndim=2] np_valid_x,             # <<<<<<<<<<<<<<
   __pyx_pybuffernd_np_valid_x.rcbuffer = &__pyx_pybuffer_np_valid_x;
   {
     __Pyx_BufFmt_StackElem __pyx_stack[1];
-    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_np_valid_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_np_valid_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_np_valid_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_np_valid_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
   }
   __pyx_pybuffernd_np_valid_x.diminfo[0].strides = __pyx_pybuffernd_np_valid_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_np_valid_x.diminfo[0].shape = __pyx_pybuffernd_np_valid_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_np_valid_x.diminfo[1].strides = __pyx_pybuffernd_np_valid_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_np_valid_x.diminfo[1].shape = __pyx_pybuffernd_np_valid_x.rcbuffer->pybuffer.shape[1];
 
-  /* "bayesopt.pyx":196
+  /* "bayesopt.pyx":202
  *                       dict dparams):