diff --git a/examples/svm_struct_ex.cpp b/examples/svm_struct_ex.cpp index 7c8e21b17..7d0fffe36 100644 --- a/examples/svm_struct_ex.cpp +++ b/examples/svm_struct_ex.cpp @@ -25,10 +25,10 @@ using namespace dlib; // want (e.g. a string or an image). The last typedef is the type used to represent the // PSI vector which is part of the structural SVM model which we will explain in detail // later on. But the important thing to note here is that you can use either a dense -// representation (i.e. a dlib::matrix object) or a sparse representation for the PSI -// vector. See svm_sparse_ex.cpp for an introduction to sparse vectors in dlib. Here we +// representation (i.e. a dlib::matrix object) or a sparse representation for the PSI +// vector. See svm_sparse_ex.cpp for an introduction to sparse vectors in dlib. Here we // use the same type for each of these three things to keep the example program simple. -typedef matrix column_vector; // Must be a dlib::matrix object. +typedef matrix column_vector; // Must be a dlib::matrix type. typedef matrix sample_type; // Can be anything you want. typedef matrix feature_vector_type; // Must be dlib::matrix or some kind of sparse vector. @@ -135,11 +135,11 @@ class three_class_classifier_problem : public structural_svm_problem_threaded& samples; const std::vector& labels; }; // ---------------------------------------------------------------------------------------- -// This function finally puts it all together. In here we use the -// three_class_classifier_problem along with dlib's oca cutting plane solver to find the -// optimal weights given our training data. +// This function puts it all together. In here we use the three_class_classifier_problem +// along with dlib's oca cutting plane solver to find the optimal weights given our +// training data. column_vector train_three_class_classifier ( const std::vector& samples, const std::vector& labels @@ -379,9 +379,9 @@ column_vector train_three_class_classifier ( // you can set the C parameter of the structural SVM by calling set_c(). problem.set_c(1); - // There are also a number of optional arguments: epsilon is the stopping tolerance. - // The optimizer will run until R(w) is within epsilon of its optimal value. If you - // don't set this then it defaults to 0.001. + // The epsilon parameter controls the stopping tolerance. The optimizer will run until + // R(w) is within epsilon of its optimal value. If you don't set this then it defaults + // to 0.001. problem.set_epsilon(0.0001); // Uncomment this and the optimizer will print its progress to standard out. You will @@ -393,7 +393,7 @@ column_vector train_three_class_classifier ( // separation_oracle() routine. This parameter controls the size of that cache. // Bigger values use more RAM and might make the optimizer run faster. You can also // disable it by setting it to 0 which is good to do when your separation_oracle is - // very fast. + // very fast. If you don't call this function it defaults to a value of 5. //problem.set_max_cache_size(20);