[mlpack-svn] r10108 - in mlpack/trunk/src/mlpack/methods: emst mog naive_bayes neighbor_search nnsvm svm
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Tue Nov 1 13:18:31 EDT 2011
Author: mamidon
Date: 2011-11-01 13:18:30 -0400 (Tue, 01 Nov 2011)
New Revision: 10108
Modified:
mlpack/trunk/src/mlpack/methods/emst/dtb.hpp
mlpack/trunk/src/mlpack/methods/emst/emst_main.cpp
mlpack/trunk/src/mlpack/methods/mog/mog_em_main.cpp
mlpack/trunk/src/mlpack/methods/mog/mog_l2e_main.cpp
mlpack/trunk/src/mlpack/methods/naive_bayes/nbc_main.cc
mlpack/trunk/src/mlpack/methods/neighbor_search/neighbor_search_impl.h
mlpack/trunk/src/mlpack/methods/nnsvm/nnsvm_impl.hpp
mlpack/trunk/src/mlpack/methods/nnsvm/nnsvm_main.cpp
mlpack/trunk/src/mlpack/methods/svm/svm_impl.h
Log:
Fighting with SVN over actually committing changes for timers.
Modified: mlpack/trunk/src/mlpack/methods/emst/dtb.hpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/emst/dtb.hpp 2011-11-01 16:51:58 UTC (rev 10107)
+++ mlpack/trunk/src/mlpack/methods/emst/dtb.hpp 2011-11-01 17:18:30 UTC (rev 10108)
@@ -574,11 +574,11 @@
CLI::GetParam<int>("tree/leaf_size") =
CLI::GetParam<size_t>("naive/leaf_size");
- CLI::StartTimer("naive/tree_building");
+ Timers::StartTimer("naive/tree_building");
tree_ = new DTBTree(data_points_, old_from_new_permutation_);
- CLI::StopTimer("naive/tree_building");
+ Timers::StopTimer("naive/tree_building");
}
else {
tree_ = NULL;
@@ -611,7 +611,7 @@
*/
void ComputeMST(arma::mat& results) {
- CLI::StartTimer("emst/MST_computation");
+ Timers::StartTimer("emst/MST_computation");
while (number_of_edges_ < (number_of_points_ - 1)) {
ComputeNeighbors_();
@@ -623,7 +623,7 @@
Log::Info << "number_of_loops = " << number_of_loops_ << std::endl;
}
- CLI::StopTimer("emst/MST_computation");
+ Timers::StopTimer("emst/MST_computation");
// if (results != NULL) {
Modified: mlpack/trunk/src/mlpack/methods/emst/emst_main.cpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/emst/emst_main.cpp 2011-11-01 16:51:58 UTC (rev 10107)
+++ mlpack/trunk/src/mlpack/methods/emst/emst_main.cpp 2011-11-01 17:18:30 UTC (rev 10108)
@@ -8,9 +8,9 @@
* @author Bill March (march at gatech.edu)
*/
-#include "dtb.hpp"
#include <mlpack/core.h>
+#include "dtb.hpp"
PARAM_FLAG("using_thor", "For when an implementation of thor is around",
"emst");
@@ -66,7 +66,7 @@
/* Compare the naive output to the DTB output */
- CLI::StartTimer("naive/comparison");
+ Timers::StartTimer("naive/comparison");
// Check if the edge lists are the same
@@ -138,7 +138,7 @@
std::endl << std::endl;
}
- CLI::StopTimer("naive/comparison");
+ Timers::StopTimer("naive/comparison");
std::string naive_output_filename =
CLI::GetParam<std::string>("naive/output_file");
Modified: mlpack/trunk/src/mlpack/methods/mog/mog_em_main.cpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/mog/mog_em_main.cpp 2011-11-01 16:51:58 UTC (rev 10107)
+++ mlpack/trunk/src/mlpack/methods/mog/mog_em_main.cpp 2011-11-01 17:18:30 UTC (rev 10108)
@@ -49,16 +49,16 @@
CLI::GetParam<int>("mog/d") = data_points.n_rows;
////// Timing the initialization of the mixture model //////
- CLI::StartTimer("mog/model_init");
+ Timers::StartTimer("mog/model_init");
mog.Init(1, data_points.n_rows);
- CLI::StopTimer("mog/model_init");
+ Timers::StopTimer("mog/model_init");
////// Computing the parameters of the model using the EM algorithm //////
std::vector<double> results;
- CLI::StartTimer("mog/EM");
+ Timers::StartTimer("mog/EM");
mog.ExpectationMaximization(data_points);
- CLI::StopTimer("mog/EM");
+ Timers::StopTimer("mog/EM");
mog.Display();
mog.OutputResults(results);
Modified: mlpack/trunk/src/mlpack/methods/mog/mog_l2e_main.cpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/mog/mog_l2e_main.cpp 2011-11-01 16:51:58 UTC (rev 10107)
+++ mlpack/trunk/src/mlpack/methods/mog/mog_l2e_main.cpp 2011-11-01 17:18:30 UTC (rev 10108)
@@ -62,21 +62,21 @@
NelderMead opt;
////// Initializing the optimizer //////
- CLI::StartTimer("opt/init_opt");
+ Timers::StartTimer("opt/init_opt");
opt.Init(MoGL2E::L2ErrorForOpt, data_points);
- CLI::StopTimer("opt/init_opt");
+ Timers::StopTimer("opt/init_opt");
////// Getting starting points for the optimization //////
arma::mat pts(param_dim, param_dim + 1);
- CLI::StartTimer("opt/get_init_pts");
+ Timers::StartTimer("opt/get_init_pts");
MoGL2E::MultiplePointsGenerator(pts, data_points, number_of_gaussians);
- CLI::StopTimer("opt/get_init_pts");
+ Timers::StopTimer("opt/get_init_pts");
////// The optimization //////
- CLI::StartTimer("opt/optimizing");
+ Timers::StartTimer("opt/optimizing");
opt.Eval(pts);
- CLI::StopTimer("opt/optimizing");
+ Timers::StopTimer("opt/optimizing");
////// Making model with the optimal parameters //////
// This is a stupid way to do it and putting the 0s there ensures it will
@@ -87,21 +87,21 @@
QuasiNewton opt;
////// Initializing the optimizer //////
- CLI::StartTimer("opt/init_opt");
+ Timers::StartTimer("opt/init_opt");
opt.Init(MoGL2E::L2ErrorForOpt, data_points);
- CLI::StopTimer("opt/init_opt");
+ Timers::StopTimer("opt/init_opt");
////// Getting starting point for the optimization //////
arma::vec pt(param_dim);
- CLI::StartTimer("opt/get_init_pt");
+ Timers::StartTimer("opt/get_init_pt");
MoGL2E::InitialPointGenerator(pt, data_points, number_of_gaussians);
- CLI::StopTimer("opt/get_init_pt");
+ Timers::StopTimer("opt/get_init_pt");
////// The optimization //////
- CLI::StartTimer("opt/optimizing");
+ Timers::StartTimer("opt/optimizing");
opt.Eval(pt);
- CLI::StopTimer("opt/optimizing");
+ Timers::StopTimer("opt/optimizing");
////// Making model with optimal parameters //////
// This is a stupid way to do it and putting the 0s there ensures it will
Modified: mlpack/trunk/src/mlpack/methods/naive_bayes/nbc_main.cc
===================================================================
--- mlpack/trunk/src/mlpack/methods/naive_bayes/nbc_main.cc 2011-11-01 16:51:58 UTC (rev 10107)
+++ mlpack/trunk/src/mlpack/methods/naive_bayes/nbc_main.cc 2011-11-01 17:18:30 UTC (rev 10108)
@@ -87,25 +87,25 @@
////// SIMPLE NAIVE BAYES CLASSIFICATCLIN ASSUMING THE DATA TO BE UNIFORMLY DISTRIBUTED //////
////// Timing the training of the Naive Bayes Classifier //////
- CLI::StartTimer("nbc/training");
+ Timers::StartTimer("nbc/training");
////// Create and train the classifier
SimpleNaiveBayesClassifier nbc = SimpleNaiveBayesClassifier(training_data);
////// Stop training timer //////
- CLI::StopTimer("nbc/training");
+ Timers::StopTimer("nbc/training");
////// Timing the testing of the Naive Bayes Classifier //////
////// The variable that contains the result of the classification
arma::vec results;
- CLI::StartTimer("nbc/testing");
+ Timers::StartTimer("nbc/testing");
////// Calling the function that classifies the test data
nbc.Classify(testing_data, results);
////// Stop testing timer //////
- CLI::StopTimer("nbc/testing");
+ Timers::StopTimer("nbc/testing");
////// OUTPUT RESULTS //////
std::string output_filename = CLI::GetParam<std::string>("nbc/output");
Modified: mlpack/trunk/src/mlpack/methods/neighbor_search/neighbor_search_impl.h
===================================================================
--- mlpack/trunk/src/mlpack/methods/neighbor_search/neighbor_search_impl.h 2011-11-01 16:51:58 UTC (rev 10107)
+++ mlpack/trunk/src/mlpack/methods/neighbor_search/neighbor_search_impl.h 2011-11-01 17:18:30 UTC (rev 10108)
@@ -46,7 +46,7 @@
neighbor_distances_.fill(SortPolicy::WorstDistance());
// We'll time tree building
- CLI::StartTimer("neighbor_search/tree_building");
+ Timers::StartTimer("neighbor_search/tree_building");
// This call makes each tree from a matrix, leaf size, and two arrays
// that record the permutation of the data points
@@ -54,7 +54,7 @@
reference_tree_ = new TreeType(references_, old_from_new_references_);
// Stop the timer we started above
- CLI::StopTimer("neighbor_search/tree_building");
+ Timers::StopTimer("neighbor_search/tree_building");
}
// We call an advanced constructor of arma::mat which allows us to alias a
@@ -88,7 +88,7 @@
neighbor_distances_.fill(SortPolicy::WorstDistance());
// We'll time tree building
- CLI::StartTimer("neighbor_search/tree_building");
+ Timers::StartTimer("neighbor_search/tree_building");
// This call makes each tree from a matrix, leaf size, and two arrays
// that record the permutation of the data points
@@ -97,7 +97,7 @@
reference_tree_ = new TreeType(references_, old_from_new_references_);
// Stop the timer we started above
- CLI::StopTimer("neighbor_search/tree_building");
+ Timers::StopTimer("neighbor_search/tree_building");
}
/**
@@ -366,7 +366,7 @@
arma::Mat<size_t>& resulting_neighbors,
arma::mat& distances) {
- CLI::StartTimer("neighbor_search/computing_neighbors");
+ Timers::StartTimer("neighbor_search/computing_neighbors");
if (naive_) {
// Run the base case computation on all nodes
if (query_tree_)
@@ -405,7 +405,7 @@
}
}
- CLI::StopTimer("neighbor_search/computing_neighbors");
+ Timers::StopTimer("neighbor_search/computing_neighbors");
// We need to initialize the results list before filling it
resulting_neighbors.set_size(neighbor_indices_.n_rows,
Modified: mlpack/trunk/src/mlpack/methods/nnsvm/nnsvm_impl.hpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/nnsvm/nnsvm_impl.hpp 2011-11-01 16:51:58 UTC (rev 10107)
+++ mlpack/trunk/src/mlpack/methods/nnsvm/nnsvm_impl.hpp 2011-11-01 17:18:30 UTC (rev 10108)
@@ -62,9 +62,9 @@
nnsmo.Init(dataset, param_.c_, param_.b_, param_.eps_, param_.max_iter_);
/* 2-classes NNSVM training using NNSMO */
- CLI::StartTimer("nnsvm/nnsvm_train");
+ Timers::StartTimer("nnsvm/nnsvm_train");
nnsmo.Train();
- CLI::StopTimer("nnsvm/nnsvm_train");
+ Timers::StopTimer("nnsvm/nnsvm_train");
/* Get the trained bi-class model */
nnsmo.GetNNSVM(support_vectors_, model_.sv_coef_, model_.w_);
Modified: mlpack/trunk/src/mlpack/methods/nnsvm/nnsvm_main.cpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/nnsvm/nnsvm_main.cpp 2011-11-01 16:51:58 UTC (rev 10107)
+++ mlpack/trunk/src/mlpack/methods/nnsvm/nnsvm_main.cpp 2011-11-01 17:18:30 UTC (rev 10108)
@@ -65,7 +65,7 @@
CLI::GetParam<double>("nnsvm/eps"),
CLI::GetParam<int>("nnsvm/max_iter"));
- CLI::StartTimer("nnsvm/nnsvm_train");
+ Timers::StartTimer("nnsvm/nnsvm_train");
Log::Debug << "nnsvm_train_time" << CLI::GetParam<timeval>("nnsvm/nnsvm_train").tv_usec / 1e6 << std::endl;
/* training and testing, thus no need to load model from file */
if (mode=="train_test")
Modified: mlpack/trunk/src/mlpack/methods/svm/svm_impl.h
===================================================================
--- mlpack/trunk/src/mlpack/methods/svm/svm_impl.h 2011-11-01 16:51:58 UTC (rev 10107)
+++ mlpack/trunk/src/mlpack/methods/svm/svm_impl.h 2011-11-01 17:18:30 UTC (rev 10108)
@@ -162,9 +162,9 @@
/* Initialize kernel */
/* 2-classes SVM training using SMO */
- CLI::StartTimer("svm/train_smo");
+ Timers::StartTimer("svm/train_smo");
smo.Train(learner_typeid, &dataset_bi);
- CLI::StopTimer("svm/train_smo");
+ Timers::StopTimer("svm/train_smo");
/* Get the trained bi-class model */
models_[ct].bias_ = smo.Bias(); /* bias */
More information about the mlpack-svn
mailing list