Commits

Ruben Martinez-Cantin committed 1ed3f88

Solved bug in parameter allocation

  • Participants
  • Parent commits dd9a65b

Comments (0)

Files changed (6)

matlab/bayesoptextras.h

 
   if (val) {
     if( mxIsChar(val) ) {
+      printf("Loading %s. Size %d by %d", name, mxGetM(val), mxGetN(val));
       if ( mxGetString(val, result, 1+(mxGetM(val) * mxGetN(val)))) {
 	  mexErrMsgTxt("Error loading string.");
 	}

matlab/compile_matlab.m

     else
         if exist('../lib/bayesopt.so','file')
             disp('Compiling dynamic library');
-            mex -output bayesopt bayesoptmex.c ../lib/bayesopt.so ../lib/libnlopt.so ...
-                -I../include -I../wrappers -I../nlopt/api 
+            mex -g -output bayesopt bayesoptmex.c ../lib/bayesopt.so ...
+                -I../include -I../wrappers
 
-            mex -output bayesoptdisc bayesoptdiscmex.c ../lib/bayesopt.so ...
-                ../lib/libnlopt.so -I../include -I../wrappers -I../nlopt/api ...
+            mex -g -output bayesoptdisc bayesoptdiscmex.c ../lib/bayesopt.so ...
+                -I../include -I../wrappers
                 
         else
             disp('Error: File not found');
 addpath('testfunctions')
 
 params.n_iterations = 100;
-params.n_init_iterations = 50;
+params.n_init_iterations = 5;
 params.crit_name = 'cEI';
 params.surr_name = 'sGaussianProcessNormal';
 params.noise = 0.005;
 params.kernel_name = 'kMaternISO3';
 params.kernel_hp_mean = [0.5];
 params.kernel_hp_std = [10];
-params.verbose_level = 0;
+params.verbose_level = 1;
 params.log_filename = 'matbopt.log';
 
 % n = 5;

src/nonparametricprocess.cpp

 
     std::string name = parameters.surr_name;
 
+    FILE_LOG(logINFO) << "Using surrogate: " << name;
+    FILE_LOG(logINFO) << "Using kernel: " << parameters.kernel.name;
+
     if (!name.compare("sGaussianProcess"))
       s_ptr = new GaussianProcess(dim,parameters);
     else  if(!name.compare("sGaussianProcessML"))

src/parameters.cpp

 }
 
 
-char DEF_LOG_FILE[] = "bayesopt.log";
-char DEF_SUR_NAME[] = "sGaussianProcess";
-char DEF_KERNEL_NAME[] = "kMaternISO3";
-char DEF_MEAN_NAME[] = "mOne";
-char DEF_CRITERIA_NAME[] = "cEI";
+char DEF_LOG_FILE[128] = "bayesopt.log";
+char DEF_SUR_NAME[128] = "sGaussianProcess";
+char DEF_KERNEL_NAME[128] = "kMaternISO3";
+char DEF_MEAN_NAME[128] = "mOne";
+char DEF_CRITERIA_NAME[128] = "cEI";
 
 static const kernel_parameters DEFAULT_KERNEL = {
   DEF_KERNEL_NAME, {KERNEL_THETA}, {KERNEL_SIGMA}, 1 
 template <typename T>
 std::string Log<T>::ToString(TLogLevel level)
 {
-	static const char* const buffer[] = {"ERROR", "WARNING", "INFO", "DEBUG", "DEBUG1", "DEBUG2", "DEBUG3", "DEBUG4"};
+    static const char* const buffer[] = {"ERROR", "WARNING", "INFO", "DEBUG", "DEBUG1", "DEBUG2", "DEBUG3", "DEBUG4"};
     return buffer[level];
 }