Use double instead of float for extracted features

Co-authored-by: Davis E. King <davis@dlib.net>
This commit is contained in:
Adrià Arrufat 2021-11-02 13:07:14 +01:00 committed by GitHub
parent 29e5319ee9
commit 9a50809ebf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -293,10 +293,10 @@ try
model::feats fnet(layer<5>(net)); model::feats fnet(layer<5>(net));
// And we will generate all the features for the training set to train a multiclass SVM // And we will generate all the features for the training set to train a multiclass SVM
// classifier. // classifier.
std::vector<matrix<float, 0, 1>> features; std::vector<matrix<double, 0, 1>> features;
cout << "Extracting features for linear classifier..." << endl; cout << "Extracting features for linear classifier..." << endl;
features = fnet(training_images, 4 * batch_size); features = fnet(training_images, 4 * batch_size);
svm_multiclass_linear_trainer<linear_kernel<matrix<float,0,1>>, unsigned long> trainer; svm_multiclass_linear_trainer<linear_kernel<matrix<double,0,1>>, unsigned long> trainer;
trainer.set_num_threads(std::thread::hardware_concurrency()); trainer.set_num_threads(std::thread::hardware_concurrency());
// The most appropriate C setting could be found automatically by using find_max_global(). See the docs for // The most appropriate C setting could be found automatically by using find_max_global(). See the docs for
// find_max_global() for further information and take particular note of model_selection_ex.cpp. // find_max_global() for further information and take particular note of model_selection_ex.cpp.