From d5d43d82c0137e08553e44345c609cdd1a7931c7 Mon Sep 17 00:00:00 2001 From: Nikhil Raj Date: Fri, 17 Jun 2022 13:24:58 +0100 Subject: Update Doxygen for 22.05 patch release * Pooling3D added to tfLite delegate * Available in tag 22.05.01 Signed-off-by: Nikhil Raj Change-Id: I8d605bba4e87d30baa2c6d7b338c78a4400dc021 --- 22.05.01/_model_accuracy_checker_8cpp_source.xhtml | 123 +++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 22.05.01/_model_accuracy_checker_8cpp_source.xhtml (limited to '22.05.01/_model_accuracy_checker_8cpp_source.xhtml') diff --git a/22.05.01/_model_accuracy_checker_8cpp_source.xhtml b/22.05.01/_model_accuracy_checker_8cpp_source.xhtml new file mode 100644 index 0000000000..0175904549 --- /dev/null +++ b/22.05.01/_model_accuracy_checker_8cpp_source.xhtml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + +ArmNN: src/armnnUtils/ModelAccuracyChecker.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  22.05.01 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
ModelAccuracyChecker.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
8 #include <armnn/Logging.hpp>
9 
10 #include <map>
11 #include <vector>
12 
13 namespace armnnUtils
14 {
15 
16 armnnUtils::ModelAccuracyChecker::ModelAccuracyChecker(const std::map<std::string, std::string>& validationLabels,
17  const std::vector<LabelCategoryNames>& modelOutputLabels)
18  : m_GroundTruthLabelSet(validationLabels)
19  , m_ModelOutputLabels(modelOutputLabels)
20 {}
21 
22 float ModelAccuracyChecker::GetAccuracy(unsigned int k)
23 {
24  if (k > 10)
25  {
26  ARMNN_LOG(warning) << "Accuracy Tool only supports a maximum of Top 10 Accuracy. "
27  "Printing Top 10 Accuracy result!";
28  k = 10;
29  }
30  unsigned int total = 0;
31  for (unsigned int i = k; i > 0; --i)
32  {
33  total += m_TopK[i];
34  }
35  return static_cast<float>(total * 100) / static_cast<float>(m_ImagesProcessed);
36 }
37 
38 // Split a string into tokens by a delimiter
39 std::vector<std::string>
40  SplitBy(const std::string& originalString, const std::string& delimiter, bool includeEmptyToken)
41 {
42  std::vector<std::string> tokens;
43  size_t cur = 0;
44  size_t next = 0;
45  while ((next = originalString.find(delimiter, cur)) != std::string::npos)
46  {
47  // Skip empty tokens, unless explicitly stated to include them.
48  if (next - cur > 0 || includeEmptyToken)
49  {
50  tokens.push_back(originalString.substr(cur, next - cur));
51  }
52  cur = next + delimiter.size();
53  }
54  // Get the remaining token
55  // Skip empty tokens, unless explicitly stated to include them.
56  if (originalString.size() - cur > 0 || includeEmptyToken)
57  {
58  tokens.push_back(originalString.substr(cur, originalString.size() - cur));
59  }
60  return tokens;
61 }
62 
63 // Remove any preceding and trailing character specified in the characterSet.
64 std::string Strip(const std::string& originalString, const std::string& characterSet)
65 {
66  ARMNN_ASSERT(!characterSet.empty());
67  const std::size_t firstFound = originalString.find_first_not_of(characterSet);
68  const std::size_t lastFound = originalString.find_last_not_of(characterSet);
69  // Return empty if the originalString is empty or the originalString contains only to-be-striped characters
70  if (firstFound == std::string::npos || lastFound == std::string::npos)
71  {
72  return "";
73  }
74  return originalString.substr(firstFound, lastFound + 1 - firstFound);
75 }
76 } // namespace armnnUtils
+
ModelAccuracyChecker(const std::map< std::string, std::string > &validationLabelSet, const std::vector< LabelCategoryNames > &modelOutputLabels)
Constructor for a model top k accuracy checker.
+
float GetAccuracy(unsigned int k)
Get Top K accuracy.
+
#define ARMNN_LOG(severity)
Definition: Logging.hpp:205
+
std::string Strip(const std::string &originalString, const std::string &characterSet)
Remove any preceding and trailing character specified in the characterSet.
+
std::vector< std::string > SplitBy(const std::string &originalString, const std::string &delimiter, bool includeEmptyToken)
Split a string into tokens by a delimiter.
+ +
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14
+ + +
+
+ + + + -- cgit v1.2.1