Commit eec39b4d authored by Davis King's avatar Davis King

Fixed incorrect requires clause on the cross_validate_trainer() and

cross_validate_trainer_threaded() routines.
parent 16d089d2
......@@ -420,10 +420,10 @@ namespace dlib
// make sure requires clause is not broken
DLIB_ASSERT(is_binary_classification_problem(x,y) == true &&
1 < folds && folds <= x.nr(),
1 < folds && folds <= std::min(sum(y>0),sum(y<0)),
"\tmatrix cross_validate_trainer()"
<< "\n\t invalid inputs were given to this function"
<< "\n\t x.nr(): " << x.nr()
<< "\n\t std::min(sum(y>0),sum(y<0)): " << std::min(sum(y>0),sum(y<0))
<< "\n\t folds: " << folds
<< "\n\t is_binary_classification_problem(x,y): " << ((is_binary_classification_problem(x,y))? "true":"false")
);
......
......@@ -369,7 +369,8 @@ namespace dlib
/*!
requires
- is_binary_classification_problem(x,y) == true
- 1 < folds <= x.nr()
- 1 < folds <= std::min(sum(y>0),sum(y<0))
(e.g. There must be at least as many examples of each class as there are folds)
- trainer_type == some kind of binary classification trainer object (e.g. svm_nu_trainer)
ensures
- performs k-fold cross validation by using the given trainer to solve the
......
......@@ -94,11 +94,11 @@ namespace dlib
// make sure requires clause is not broken
DLIB_ASSERT(is_binary_classification_problem(x,y) == true &&
1 < folds && folds <= x.nr() &&
1 < folds && folds <= std::min(sum(y>0),sum(y<0)) &&
num_threads > 0,
"\tmatrix cross_validate_trainer()"
<< "\n\t invalid inputs were given to this function"
<< "\n\t x.nr(): " << x.nr()
<< "\n\t std::min(sum(y>0),sum(y<0)): " << std::min(sum(y>0),sum(y<0))
<< "\n\t folds: " << folds
<< "\n\t num_threads: " << num_threads
<< "\n\t is_binary_classification_problem(x,y): " << ((is_binary_classification_problem(x,y))? "true":"false")
......
......@@ -28,7 +28,8 @@ namespace dlib
/*!
requires
- is_binary_classification_problem(x,y) == true
- 1 < folds <= x.nr()
- 1 < folds <= std::min(sum(y>0),sum(y<0))
(e.g. There must be at least as many examples of each class as there are folds)
- trainer_type == some kind of trainer object (e.g. svm_nu_trainer)
- num_threads > 0
ensures
......
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