Source

BayesOpt / src / parameters.cpp

Diff from to

File src/parameters.cpp

 
 
 
-/*surrogate_name str2surrogate(const char* name)
-{
-  if      (!strcmp(name,  "GAUSSIAN_PROCESS"))
-    return S_GAUSSIAN_PROCESS;
-  if      (!strcmp(name,  "GAUSSIAN_PROCESS_ML"))
-    return S_GAUSSIAN_PROCESS_ML;
-  else if (!strcmp(name,  "STUDENT_T_PROCESS_NORMAL_INV_GAMMA"))
-    return S_STUDENT_T_PROCESS_NORMAL_INV_GAMMA;
-  else if (!strcmp(name,  "STUDENT_T_PROCESS_JEFFREYS"))
-    return S_STUDENT_T_PROCESS_JEFFREYS;
-  else return S_ERROR;
-}
-
-const char* surrogate2str(surrogate_name name)
-{
-  switch(name)
-    {
-    case S_GAUSSIAN_PROCESS: return "GAUSSIAN_PROCESS"; 
-    case S_GAUSSIAN_PROCESS_ML: return "GAUSSIAN_PROCESS_ML"; 
-    case S_STUDENT_T_PROCESS_NORMAL_INV_GAMMA: return "STUDENT_T_PROCESS_NORMAL_INV_GAMMA";
-    case S_STUDENT_T_PROCESS_JEFFREYS: return "STUDENT_T_PROCESS_JEFFREYS"; 
-    case S_ERROR:
-    default: return "ERROR!";
-    }
-    }*/
-
-
 learning_type str2learn(const char* name)
 {
   if      (!strcmp(name,  "L_ML"))
     }
 }
 
-
+/*
 char DEF_LOG_FILE[128] = "bayesopt.log";
 char DEF_SUR_NAME[128] = "sGaussianProcess";
 char DEF_KERNEL_NAME[128] = "kMaternISO3";
 
 
 static const bopt_params DEFAULT_PARAMS = {
-  DEFAULT_ITERATIONS, MAX_INNER_EVALUATIONS, 
-  DEFAULT_SAMPLES, 0, 
-  DEFAULT_VERBOSE, DEF_LOG_FILE,
-  DEF_SUR_NAME,
-  DEFAULT_SIGMA, DEFAULT_NOISE,
-  PRIOR_ALPHA, PRIOR_BETA, 
-  L_MAP, 0.0,
-  DEFAULT_KERNEL, DEFAULT_MEAN,
-  DEF_CRITERIA_NAME, {1.0}, 1
+  DEFAULT_ITERATIONS, 
+  MAX_INNER_EVALUATIONS, 
+  DEFAULT_SAMPLES, 
+  0, 
+  1,
+
+  DEFAULT_VERBOSE, 
+  &DEF_LOG_FILE[0],
+  
+  &DEF_SUR_NAME[0],
+  DEFAULT_SIGMA, 
+  DEFAULT_NOISE,
+  PRIOR_ALPHA, 
+  PRIOR_BETA, 
+  L_MAP, 
+  0.0,
+  
+  DEFAULT_KERNEL, 
+  DEFAULT_MEAN,
+  
+  DEF_CRITERIA_NAME, 
+  {1.0}, 
+  1
 };
-
+*/
 
 bopt_params initialize_parameters_to_default(void)
 {
-  return DEFAULT_PARAMS;
+  kernel_parameters kernel;
+  kernel.name = new char[128];
+  strcpy(kernel.name,"kMaternISO3");
+
+  kernel.hp_mean[0] = KERNEL_THETA;
+  kernel.hp_std[0] = KERNEL_SIGMA;
+  kernel.n_hp = 1;
+  
+  mean_parameters mean;
+  mean.name = new char[128];
+  strcpy(mean.name,"mOne");
+
+  mean.coef_mean[0] = MEAN_MU;
+  mean.coef_std[0] = MEAN_SIGMA;
+  mean.n_coef = 1;
+  
+
+  bopt_params params;
+  params.n_iterations =   DEFAULT_ITERATIONS;
+  params.n_inner_iterations = MAX_INNER_EVALUATIONS;
+  params.n_init_samples = DEFAULT_SAMPLES;
+  params.n_iter_relearn = 0;
+  params.init_method = 1;
+
+  params.verbose_level = DEFAULT_VERBOSE;
+  params.log_filename = new char[128];
+  strcpy(params.log_filename,"bayesopt.log");
+
+  params.surr_name = new char[128];
+  strcpy(params.surr_name,"sGaussianProcess");
+
+  params.sigma_s = DEFAULT_SIGMA;
+  params.noise = DEFAULT_NOISE;
+  params.alpha = PRIOR_ALPHA;
+  params.beta = PRIOR_BETA;
+  params.l_type = L_MAP;
+  params.epsilon = 0.0;
+  
+  params.crit_name = new char[128];
+  strcpy(params.crit_name,"cEI");
+  params.crit_params[0] = 1.0;
+  params.n_crit_params = 1;
+
+  params.kernel = kernel;
+  params.mean = mean;
+  return params;
 }