Commits

Ruben Martinez-Cantin  committed 0a42946

Fixing default mcmc samples

  • Participants
  • Parent commits 835e724

Comments (0)

Files changed (3)

File examples/bo_camelback.cpp

   
   ExampleCamelback camel(par);
 
-  vectord lb(2); lb(0) = -2; lb(1) = -1;
-  vectord ub(2); ub(0) =  2; ub(1) = 1;
-
-  camel.setBoundingBox(lb,ub);
 
   std::ofstream timelog;
   timelog.open("time_camel.log");

File examples/bo_compare.cpp

 {
   bopt_params par = initialize_parameters_to_default();
   par.n_iterations = 190;
-  par.verbose_level = 0;
+  par.verbose_level = 1;
   par.noise = 1e-10;
+  par.force_jump = 30;
 
   std::ofstream log;
   std::clock_t start_t;
       branin.initializeOptimization();
       
       for (size_t jj = 0; jj < par.n_iterations; ++jj)
-	{      
-	  branin.stepOptimization();
-	  if (jj == 50)
-	    {
-	      result = branin.getFinalResult();	      
-	      log << branin.evaluateSample(result) << ", ";
-	    }
-	}
+  	{      
+  	  branin.stepOptimization();
+  	  if (jj == 50)
+  	    {
+  	      result = branin.getFinalResult();	      
+  	      log << branin.evaluateSample(result) << ", ";
+  	    }
+  	}
       result = branin.getFinalResult();	      
       log << branin.evaluateSample(result) << ", ";
       
       log << static_cast<double>(clock() - start_t) / static_cast<double>(CLOCKS_PER_SEC)
-	  << std::endl;
+  	  << std::endl;
       }
 
   log.close();
       camel.initializeOptimization();
       
       for (size_t jj = 0; jj < par.n_iterations; ++jj)
-	{      
-	  camel.stepOptimization();
-	  if (jj == 50)
-	    {
-	      result = camel.getFinalResult();	      
-	      log << camel.evaluateSample(result) << ", ";
-	    }
-	}
+  	{      
+  	  camel.stepOptimization();
+  	  if (jj == 50)
+  	    {
+  	      result = camel.getFinalResult();	      
+  	      log << camel.evaluateSample(result) << ", ";
+  	    }
+  	}
       result = camel.getFinalResult();	      
       log << camel.evaluateSample(result) << ", ";
       
       log << static_cast<double>(clock() - start_t) / static_cast<double>(CLOCKS_PER_SEC)
-	  << std::endl;
+  	  << std::endl;
       }
 
   log.close();
       hart.initializeOptimization();
       
       for (size_t jj = 0; jj < par.n_iterations; ++jj)
-	{      
-	  hart.stepOptimization();
-	  if (jj == 50)
-	    {
-	      result = hart.getFinalResult();	      
-	      log << hart.evaluateSample(result) << ", ";
-	    }
-	}
+  	{      
+  	  hart.stepOptimization();
+  	  if (jj == 50)
+  	    {
+  	      result = hart.getFinalResult();	      
+  	      log << hart.evaluateSample(result) << ", ";
+  	    }
+  	}
       result = hart.getFinalResult();	      
       log << hart.evaluateSample(result) << ", ";
       
       log << static_cast<double>(clock() - start_t) / static_cast<double>(CLOCKS_PER_SEC)
-	  << std::endl;
+  	  << std::endl;
       }
 
   log.close();

File src/mcmc_sampler.cpp

   {
     mAlg = SLICE_MCMC;
     mDims = dim;
-    nBurnOut = 500;
-    nSamples = 100;
+    nBurnOut = 100;
+    nSamples = 10;
     mStepOut = true;
     mSigma = svectord(dim,6);
   };