Commit 89bfb786 authored by Davis King's avatar Davis King

Fixed be_verbose not doing the right thing.

parent 0fe68bb5
...@@ -70,6 +70,7 @@ namespace dlib ...@@ -70,6 +70,7 @@ namespace dlib
}; };
if (be_verbose)
std::cout << "Searching for best RBF-SVM training parameters..." << std::endl; std::cout << "Searching for best RBF-SVM training parameters..." << std::endl;
auto result = find_max_global( auto result = find_max_global(
default_thread_pool(), default_thread_pool(),
...@@ -82,15 +83,20 @@ namespace dlib ...@@ -82,15 +83,20 @@ namespace dlib
double best_c1 = result.x(1); double best_c1 = result.x(1);
double best_c2 = result.x(2); double best_c2 = result.x(2);
if (be_verbose)
{
std::cout << " best cross-validation score: " << result.y << std::endl; std::cout << " best cross-validation score: " << result.y << std::endl;
std::cout << " best gamma: " << best_gamma << " best c1: " << best_c1 << " best c2: "<< best_c2 << std::endl; std::cout << " best gamma: " << best_gamma << " best c1: " << best_c1 << " best c2: "<< best_c2 << std::endl;
}
svm_c_trainer<kernel_type> trainer; svm_c_trainer<kernel_type> trainer;
trainer.set_kernel(kernel_type(best_gamma)); trainer.set_kernel(kernel_type(best_gamma));
trainer.set_c_class1(best_c1); trainer.set_c_class1(best_c1);
trainer.set_c_class2(best_c2); trainer.set_c_class2(best_c2);
if (be_verbose)
std::cout << "Training final classifier with best parameters..." << std::endl; std::cout << "Training final classifier with best parameters..." << std::endl;
df.function = trainer.train(x,y); df.function = trainer.train(x,y);
return df; return df;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment