Skip to content

Commit a5c205c

Browse files
committed
Merge branch 'master' of https://github.com/cmdevries/LMW-tree
Conflicts: src/EMTree.cpp
2 parents 8272821 + e05f35d commit a5c205c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/EMTree.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,16 +405,17 @@ void journalPaperExperiments(vector<SVector<bool>*>& vectors) {
405405
// run TSVQ vs EM-tree convergence
406406
if (true) {
407407
int depth = 3, m = 10;
408-
int iterRange = 10; // test RMSE at 1 to maxiters iterations
408+
int iterRange = 100; // test RMSE at 1 to maxiters iterations
409+
int seed = 1234; // start with same seed each time
409410

410411
//TSVQ
411412
if (true) {
412413
vector<double> rmse;
413414
vector<int> clusters;
414415
vector<double> seconds;
415416
for (int maxiters = 1; maxiters <= iterRange; ++maxiters) {
417+
srand(seed);
416418
boost::timer::auto_cpu_timer all;
417-
srand(1234);
418419
TSVQ<vecType, clustererType, distanceType, protoType> tsvq(m, depth, maxiters);
419420
tsvq.cluster(vectors);
420421
all.stop();
@@ -431,6 +432,7 @@ void journalPaperExperiments(vector<SVector<bool>*>& vectors) {
431432

432433
//EM-tree
433434
if (true) {
435+
cout << "EM-tree convergence" << endl;
434436
vector<double> rmse;
435437
vector<int> clusters;
436438
vector<double> seconds;
@@ -439,8 +441,8 @@ void journalPaperExperiments(vector<SVector<bool>*>& vectors) {
439441
for (int i = 0; i < depth - 1; ++i) {
440442
splits.push_back(m);
441443
}
444+
srand(seed);
442445
boost::timer::auto_cpu_timer all;
443-
srand(1234);
444446
EMTree<vecType, clustererType, distanceType, protoType> emt(m);
445447
// seeding does first iteration
446448
emt.seedSingleThreaded(vectors, splits);
@@ -533,7 +535,7 @@ void journalPaperExperiments(vector<SVector<bool>*>& vectors) {
533535
}
534536

535537
// run kmeans exerpiments
536-
if (true) {
538+
if (false) {
537539
int maxiters = 1000;
538540
cout << "k-means maxiters=" << maxiters << endl;
539541
vector<double> rmse;
@@ -559,9 +561,9 @@ void journalPaperExperiments(vector<SVector<bool>*>& vectors) {
559561
}
560562

561563
// run K-tree experiments
562-
if (false) {
564+
if (true) {
563565
// build tree
564-
vector<int> orders = {10000, 5000, 2500, 1000, 750, 500, 400, 300, 250, 200, 150, 100, 75, 50, 25};
566+
vector<int> orders = {100};//{10000, 5000, 2500, 1000, 750, 500, 400, 300, 250, 200, 150, 100, 75, 50, 25};
565567
for (int m : orders) {
566568
const int maxiters = 1000;
567569
cout << "-----" << endl;

0 commit comments

Comments
 (0)