From 6e96c4e040676d007cfc3fbea5f2cf3160054107 Mon Sep 17 00:00:00 2001 From: Scott Klum Date: Thu, 18 Apr 2013 20:49:41 -0400 Subject: [PATCH] CrossValidation with same training across all splits --- openbr/core/core.cpp | 3 +-- openbr/core/plot.cpp | 4 +++- openbr/openbr_plugin.cpp | 4 ++-- openbr/openbr_plugin.h | 2 +- openbr/plugins/eigen3.cpp | 1 + openbr/plugins/format.cpp | 15 ++++++++++++++- openbr/plugins/stasm.cpp | 6 ++++-- openbr/plugins/validate.cpp | 9 +++++++-- 8 files changed, 33 insertions(+), 11 deletions(-) diff --git a/openbr/core/core.cpp b/openbr/core/core.cpp index 1312dd1..09e5370 100644 --- a/openbr/core/core.cpp +++ b/openbr/core/core.cpp @@ -248,9 +248,8 @@ struct AlgorithmCore if (!partitionSizes.empty()) targetPartitions = targets.partition(partitionSizes); else targetPartitions.append(targets); - if (queryPartitions[i].first().size() != targetPartitions[i].first().size()) qFatal("Query and target templates have different number of matrices."); - outputs[i]->setBlock(queryBlock, targetBlock); + distance->compare(targetPartitions[i], queryPartitions[i], outputs[i]); Globals->currentStep += double(targets.size()) * double(queries.size()); diff --git a/openbr/core/plot.cpp b/openbr/core/plot.cpp index fe05c95..51e5439 100644 --- a/openbr/core/plot.cpp +++ b/openbr/core/plot.cpp @@ -268,7 +268,7 @@ float Evaluate(const Mat &simmat, const Mat &mask, const QString &csv) } // Write Cumulative Match Characteristic (CMC) curve - const int Max_Retrieval = 100; + const int Max_Retrieval = 200; const int Report_Retrieval = 5; float reportRetrievalRate = -1; @@ -472,6 +472,8 @@ struct RPlot } }; +// Does not work if dataset folder starts with a number + bool Plot(const QStringList &files, const br::File &destination, bool show) { qDebug("Plotting %d file(s) to %s", files.size(), qPrintable(destination)); diff --git a/openbr/openbr_plugin.cpp b/openbr/openbr_plugin.cpp index 49d62e3..7e83f9b 100644 --- a/openbr/openbr_plugin.cpp +++ b/openbr/openbr_plugin.cpp @@ -137,7 +137,7 @@ QVariant File::value(const QString &key) const QVariant File::parse(const QString &value) { - bool ok; + bool ok = false; const QPointF point = QtUtils::toPoint(value, &ok); if (ok) return point; const QRectF rect = QtUtils::toRect(value, &ok); @@ -1003,7 +1003,7 @@ void Output::reformat(const FileList &targetFiles, const FileList &queryFiles, c const int columns = targetFiles.size(); for (int i=0; isetRelative(m.at(i,i), i, j); + o->setRelative(m.at(i,j), i, j); } /* Output - protected methods */ diff --git a/openbr/openbr_plugin.h b/openbr/openbr_plugin.h index e5290b4..f6a2419 100644 --- a/openbr/openbr_plugin.h +++ b/openbr/openbr_plugin.h @@ -410,7 +410,7 @@ struct TemplateList : public QList