Source

Bayesian-Optimization / app / bo_display.cpp

Diff from to

app/bo_display.cpp

 using namespace bayesopt;
 
 int is_run=1;
+int is_step=0;
 size_t state_ii = 0;
 BayesOptBase* GLOBAL_MODEL;
 vector<double> lx,ly;
       double res = GLOBAL_MODEL->getSurrogateModel()->getLastSample(last);
       ly.push_back(res);
       lx.push_back(last(0));
+	  
+	  if (is_step) { is_run = 0; is_step = 0; }
     }
     
     int n=1000;
 void keyboard(unsigned char key, int x, int y){
     mp.keyboard(key, x, y); 
     if(key=='r'){ if(is_run==0){is_run=1;}else{is_run=0;}}
+	if(key=='s'){ is_run=1; is_step=1; } 
 }
 
 int main(int nargs, char *args[])
 {
   size_t dim = 1;
   bopt_params parameters = initialize_parameters_to_default();
-  parameters.n_init_samples = 10;
+  parameters.n_init_samples = 7;
   parameters.n_iter_relearn = 0;
   parameters.n_iterations = 300;
   parameters.verbose_level = 2;
   parameters.surr_name = "sGaussianProcessNormal";
 
   // Criterion model
-  parameters.crit_name = "cAopt";
-  parameters.n_crit_params = 0;
+  // parameters.crit_name = "cAopt";
+  // parameters.n_crit_params = 0;
 
   parameters.crit_name = "cEI";
   parameters.crit_params[0] = 1;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.