aboutsummaryrefslogtreecommitdiff
path: root/tests/InferenceTest.inl
diff options
context:
space:
mode:
authorsurmeh01 <surabhi.mehta@arm.com>2018-03-29 16:29:27 +0100
committersurmeh01 <surabhi.mehta@arm.com>2018-03-29 16:29:27 +0100
commitbceff2fb3fc68bb0aa88b886900c34b77340c826 (patch)
treed867d3e090d58d3012dfbbac456e9ea8c7f789bc /tests/InferenceTest.inl
parent4fcda0101ec3d110c1d6d7bee5c83416b645528a (diff)
downloadarmnn-bceff2fb3fc68bb0aa88b886900c34b77340c826.tar.gz
Release 18.03
Diffstat (limited to 'tests/InferenceTest.inl')
-rw-r--r--tests/InferenceTest.inl20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/InferenceTest.inl b/tests/InferenceTest.inl
index 64f97c1f87..83a99459e3 100644
--- a/tests/InferenceTest.inl
+++ b/tests/InferenceTest.inl
@@ -55,6 +55,26 @@ TestCaseResult ClassifierTestCase<TTestCaseDatabase, TModel>::ProcessResult(cons
auto& output = this->GetOutput();
const auto testCaseId = this->GetTestCaseId();
+ std::map<float,int> resultMap;
+ {
+ int index = 0;
+ for (const auto & o : output)
+ {
+ resultMap[o] = index++;
+ }
+ }
+
+ {
+ BOOST_LOG_TRIVIAL(info) << "= Prediction values for test #" << testCaseId;
+ auto it = resultMap.rbegin();
+ for (int i=0; i<5 && it != resultMap.rend(); ++i)
+ {
+ BOOST_LOG_TRIVIAL(info) << "Top(" << (i+1) << ") prediction is " << it->second <<
+ " with confidence: " << 100.0*(it->first) << "%";
+ ++it;
+ }
+ }
+
const unsigned int prediction = boost::numeric_cast<unsigned int>(
std::distance(output.begin(), std::max_element(output.begin(), output.end())));