Ryan OShea | de36e4a | 2020-03-13 16:26:19 +0000 | [diff] [blame] | 1 | <!-- Copyright (c) 2020 ARM Limited. --> |
| 2 | <!-- --> |
| 3 | <!-- SPDX-License-Identifier: MIT --> |
| 4 | <!-- --> |
| 5 | <!-- HTML header for doxygen 1.8.13--> |
| 6 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 7 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 8 | <head> |
| 9 | <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 10 | <meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| 11 | <meta name="generator" content="Doxygen 1.8.13"/> |
| 12 | <meta name="robots" content="NOINDEX, NOFOLLOW" /> |
| 13 | <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 14 | <title>ArmNN: ModelAccuracyChecker Class Reference</title> |
| 15 | <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 16 | <script type="text/javascript" src="jquery.js"></script> |
| 17 | <script type="text/javascript" src="dynsections.js"></script> |
| 18 | <link href="navtree.css" rel="stylesheet" type="text/css"/> |
| 19 | <script type="text/javascript" src="resize.js"></script> |
| 20 | <script type="text/javascript" src="navtreedata.js"></script> |
| 21 | <script type="text/javascript" src="navtree.js"></script> |
| 22 | <script type="text/javascript"> |
| 23 | $(document).ready(initResizable); |
| 24 | </script> |
| 25 | <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| 26 | <script type="text/javascript" src="search/searchdata.js"></script> |
| 27 | <script type="text/javascript" src="search/search.js"></script> |
| 28 | <script type="text/x-mathjax-config"> |
| 29 | MathJax.Hub.Config({ |
| 30 | extensions: ["tex2jax.js"], |
| 31 | jax: ["input/TeX","output/HTML-CSS"], |
| 32 | }); |
| 33 | </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script> |
| 34 | <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 35 | <link href="stylesheet.css" rel="stylesheet" type="text/css"/> |
| 36 | </head> |
| 37 | <body> |
| 38 | <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 39 | <div id="titlearea"> |
| 40 | <table cellspacing="0" cellpadding="0"> |
| 41 | <tbody> |
| 42 | <tr style="height: 56px;"> |
| 43 | <img alt="ArmNN" src="Arm_NN_horizontal_blue.png" style="max-width: 10rem; margin-top: .5rem; margin-left 10px"/> |
| 44 | <td style="padding-left: 0.5em;"> |
| 45 | <div id="projectname"> |
| 46 |  <span id="projectnumber">20.02</span> |
| 47 | </div> |
| 48 | </td> |
| 49 | </tr> |
| 50 | </tbody> |
| 51 | </table> |
| 52 | </div> |
| 53 | <!-- end header part --> |
| 54 | <!-- Generated by Doxygen 1.8.13 --> |
| 55 | <script type="text/javascript"> |
| 56 | var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| 57 | </script> |
| 58 | <script type="text/javascript" src="menudata.js"></script> |
| 59 | <script type="text/javascript" src="menu.js"></script> |
| 60 | <script type="text/javascript"> |
| 61 | $(function() { |
| 62 | initMenu('',true,false,'search.php','Search'); |
| 63 | $(document).ready(function() { init_search(); }); |
| 64 | }); |
| 65 | </script> |
| 66 | <div id="main-nav"></div> |
| 67 | </div><!-- top --> |
| 68 | <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| 69 | <div id="nav-tree"> |
| 70 | <div id="nav-tree-contents"> |
| 71 | <div id="nav-sync" class="sync"></div> |
| 72 | </div> |
| 73 | </div> |
| 74 | <div id="splitbar" style="-moz-user-select:none;" |
| 75 | class="ui-resizable-handle"> |
| 76 | </div> |
| 77 | </div> |
| 78 | <script type="text/javascript"> |
| 79 | $(document).ready(function(){initNavTree('classarmnn_utils_1_1_model_accuracy_checker.xhtml','');}); |
| 80 | </script> |
| 81 | <div id="doc-content"> |
| 82 | <!-- window showing the filter options --> |
| 83 | <div id="MSearchSelectWindow" |
| 84 | onmouseover="return searchBox.OnSearchSelectShow()" |
| 85 | onmouseout="return searchBox.OnSearchSelectHide()" |
| 86 | onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| 87 | </div> |
| 88 | |
| 89 | <!-- iframe showing the search results (closed by default) --> |
| 90 | <div id="MSearchResultsWindow"> |
| 91 | <iframe src="javascript:void(0)" frameborder="0" |
| 92 | name="MSearchResults" id="MSearchResults"> |
| 93 | </iframe> |
| 94 | </div> |
| 95 | |
| 96 | <div class="header"> |
| 97 | <div class="summary"> |
| 98 | <a href="#pub-methods">Public Member Functions</a> | |
| 99 | <a href="classarmnn_utils_1_1_model_accuracy_checker-members.xhtml">List of all members</a> </div> |
| 100 | <div class="headertitle"> |
| 101 | <div class="title">ModelAccuracyChecker Class Reference</div> </div> |
| 102 | </div><!--header--> |
| 103 | <div class="contents"> |
| 104 | |
| 105 | <p><code>#include <<a class="el" href="_model_accuracy_checker_8hpp_source.xhtml">ModelAccuracyChecker.hpp</a>></code></p> |
| 106 | <table class="memberdecls"> |
| 107 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> |
| 108 | Public Member Functions</h2></td></tr> |
| 109 | <tr class="memitem:a143dac91f5ef85d672e7bccb0358e3f7"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_utils_1_1_model_accuracy_checker.xhtml#a143dac91f5ef85d672e7bccb0358e3f7">ModelAccuracyChecker</a> (const std::map< std::string, std::string > &validationLabelSet, const std::vector< <a class="el" href="namespacearmnn_utils.xhtml#ab175d8bf2482d5a39c2331d1f0ddcece">LabelCategoryNames</a> > &modelOutputLabels)</td></tr> |
| 110 | <tr class="memdesc:a143dac91f5ef85d672e7bccb0358e3f7"><td class="mdescLeft"> </td><td class="mdescRight">Constructor for a model top k accuracy checker. <a href="#a143dac91f5ef85d672e7bccb0358e3f7">More...</a><br /></td></tr> |
| 111 | <tr class="separator:a143dac91f5ef85d672e7bccb0358e3f7"><td class="memSeparator" colspan="2"> </td></tr> |
| 112 | <tr class="memitem:ad6ddd3b77dd12eb33875d58a391b2412"><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_utils_1_1_model_accuracy_checker.xhtml#ad6ddd3b77dd12eb33875d58a391b2412">GetAccuracy</a> (unsigned int k)</td></tr> |
| 113 | <tr class="memdesc:ad6ddd3b77dd12eb33875d58a391b2412"><td class="mdescLeft"> </td><td class="mdescRight">Get Top K accuracy. <a href="#ad6ddd3b77dd12eb33875d58a391b2412">More...</a><br /></td></tr> |
| 114 | <tr class="separator:ad6ddd3b77dd12eb33875d58a391b2412"><td class="memSeparator" colspan="2"> </td></tr> |
| 115 | <tr class="memitem:a38d140dac29d228fdd1681e465507c29"><td class="memTemplParams" colspan="2">template<typename TContainer > </td></tr> |
| 116 | <tr class="memitem:a38d140dac29d228fdd1681e465507c29"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classarmnn_utils_1_1_model_accuracy_checker.xhtml#a38d140dac29d228fdd1681e465507c29">AddImageResult</a> (const std::string &imageName, std::vector< <a class="el" href="namespacearmnn.xhtml#a9eb69ebdaf4ceb8014e7c8a540266100">TContainer</a> > outputTensor)</td></tr> |
| 117 | <tr class="memdesc:a38d140dac29d228fdd1681e465507c29"><td class="mdescLeft"> </td><td class="mdescRight">Record the prediction result of an image. <a href="#a38d140dac29d228fdd1681e465507c29">More...</a><br /></td></tr> |
| 118 | <tr class="separator:a38d140dac29d228fdd1681e465507c29"><td class="memSeparator" colspan="2"> </td></tr> |
| 119 | </table> |
| 120 | <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> |
| 121 | <div class="textblock"> |
| 122 | <p class="definition">Definition at line <a class="el" href="_model_accuracy_checker_8hpp_source.xhtml#l00045">45</a> of file <a class="el" href="_model_accuracy_checker_8hpp_source.xhtml">ModelAccuracyChecker.hpp</a>.</p> |
| 123 | </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> |
| 124 | <a id="a143dac91f5ef85d672e7bccb0358e3f7"></a> |
| 125 | <h2 class="memtitle"><span class="permalink"><a href="#a143dac91f5ef85d672e7bccb0358e3f7">◆ </a></span>ModelAccuracyChecker()</h2> |
| 126 | |
| 127 | <div class="memitem"> |
| 128 | <div class="memproto"> |
| 129 | <table class="memname"> |
| 130 | <tr> |
| 131 | <td class="memname"><a class="el" href="classarmnn_utils_1_1_model_accuracy_checker.xhtml">ModelAccuracyChecker</a> </td> |
| 132 | <td>(</td> |
| 133 | <td class="paramtype">const std::map< std::string, std::string > & </td> |
| 134 | <td class="paramname"><em>validationLabelSet</em>, </td> |
| 135 | </tr> |
| 136 | <tr> |
| 137 | <td class="paramkey"></td> |
| 138 | <td></td> |
| 139 | <td class="paramtype">const std::vector< <a class="el" href="namespacearmnn_utils.xhtml#ab175d8bf2482d5a39c2331d1f0ddcece">LabelCategoryNames</a> > & </td> |
| 140 | <td class="paramname"><em>modelOutputLabels</em> </td> |
| 141 | </tr> |
| 142 | <tr> |
| 143 | <td></td> |
| 144 | <td>)</td> |
| 145 | <td></td><td></td> |
| 146 | </tr> |
| 147 | </table> |
| 148 | </div><div class="memdoc"> |
| 149 | |
| 150 | <p>Constructor for a model top k accuracy checker. </p> |
| 151 | <dl class="params"><dt>Parameters</dt><dd> |
| 152 | <table class="params"> |
| 153 | <tr><td class="paramdir">[in]</td><td class="paramname">validationLabelSet</td><td>Mapping from names of images to be validated, to category names of their corresponding ground-truth labels. </td></tr> |
| 154 | <tr><td class="paramdir">[in]</td><td class="paramname">modelOutputLabels</td><td>Mapping from output nodes to the category names of their corresponding labels Note that an output node can have multiple category names. </td></tr> |
| 155 | </table> |
| 156 | </dd> |
| 157 | </dl> |
| 158 | |
| 159 | <p class="definition">Definition at line <a class="el" href="_model_accuracy_checker_8cpp_source.xhtml#l00017">17</a> of file <a class="el" href="_model_accuracy_checker_8cpp_source.xhtml">ModelAccuracyChecker.cpp</a>.</p> |
| 160 | <div class="fragment"><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  : m_GroundTruthLabelSet(validationLabels)</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  , m_ModelOutputLabels(modelOutputLabels)</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> {}</div></div><!-- fragment --> |
| 161 | </div> |
| 162 | </div> |
| 163 | <h2 class="groupheader">Member Function Documentation</h2> |
| 164 | <a id="a38d140dac29d228fdd1681e465507c29"></a> |
| 165 | <h2 class="memtitle"><span class="permalink"><a href="#a38d140dac29d228fdd1681e465507c29">◆ </a></span>AddImageResult()</h2> |
| 166 | |
| 167 | <div class="memitem"> |
| 168 | <div class="memproto"> |
| 169 | <table class="mlabels"> |
| 170 | <tr> |
| 171 | <td class="mlabels-left"> |
| 172 | <table class="memname"> |
| 173 | <tr> |
| 174 | <td class="memname">void AddImageResult </td> |
| 175 | <td>(</td> |
| 176 | <td class="paramtype">const std::string & </td> |
| 177 | <td class="paramname"><em>imageName</em>, </td> |
| 178 | </tr> |
| 179 | <tr> |
| 180 | <td class="paramkey"></td> |
| 181 | <td></td> |
| 182 | <td class="paramtype">std::vector< <a class="el" href="namespacearmnn.xhtml#a9eb69ebdaf4ceb8014e7c8a540266100">TContainer</a> > </td> |
| 183 | <td class="paramname"><em>outputTensor</em> </td> |
| 184 | </tr> |
| 185 | <tr> |
| 186 | <td></td> |
| 187 | <td>)</td> |
| 188 | <td></td><td></td> |
| 189 | </tr> |
| 190 | </table> |
| 191 | </td> |
| 192 | <td class="mlabels-right"> |
| 193 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 194 | </tr> |
| 195 | </table> |
| 196 | </div><div class="memdoc"> |
| 197 | |
| 198 | <p>Record the prediction result of an image. </p> |
| 199 | <dl class="params"><dt>Parameters</dt><dd> |
| 200 | <table class="params"> |
| 201 | <tr><td class="paramdir">[in]</td><td class="paramname">imageName</td><td>Name of the image. </td></tr> |
| 202 | <tr><td class="paramdir">[in]</td><td class="paramname">outputTensor</td><td>Output tensor of the network running <code>imageName</code>. </td></tr> |
| 203 | </table> |
| 204 | </dd> |
| 205 | </dl> |
| 206 | |
| 207 | <p class="definition">Definition at line <a class="el" href="_model_accuracy_checker_8hpp_source.xhtml#l00073">73</a> of file <a class="el" href="_model_accuracy_checker_8hpp_source.xhtml">ModelAccuracyChecker.hpp</a>.</p> |
| 208 | |
| 209 | <p class="reference">Referenced by <a class="el" href="_model_accuracy_checker_test_8cpp_source.xhtml#l00061">BOOST_FIXTURE_TEST_CASE()</a>.</p> |
| 210 | <div class="fragment"><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  {</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="comment">// Increment the total number of images processed</span></div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  ++m_ImagesProcessed;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span> </div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  std::map<int, float> confidenceMap;</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="keyword">auto</span>& output = outputTensor[0];</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span> </div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <span class="comment">// Create a map of all predictions</span></div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  boost::apply_visitor([&confidenceMap](<span class="keyword">auto</span> && value)</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  {</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="keywordtype">int</span> index = 0;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> & o : value)</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  {</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="keywordflow">if</span> (o > 0)</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  {</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  confidenceMap.insert(std::pair<int, float>(index, static_cast<float>(o)));</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  }</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  ++index;</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  }</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  },</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  output);</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span> </div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="comment">// Create a comparator for sorting the map in order of highest probability</span></div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keyword">typedef</span> std::function<bool(std::pair<int, float>, std::pair<int, float>)> Comparator;</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span> </div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  Comparator compFunctor =</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  [](std::pair<int, float> element1, std::pair<int, float> element2)</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  {</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="keywordflow">return</span> element1.second > element2.second;</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  };</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span> </div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="comment">// Do the sorting and store in an ordered set</span></div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  std::set<std::pair<int, float>, Comparator> setOfPredictions(</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  confidenceMap.begin(), confidenceMap.end(), compFunctor);</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span> </div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="keyword">const</span> std::string correctLabel = m_GroundTruthLabelSet.at(imageName);</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span> </div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index = 1;</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="keywordflow">for</span> (std::pair<int, float> element : setOfPredictions)</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  {</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <span class="keywordflow">if</span> (index >= m_TopK.size())</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  {</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  }</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="comment">// Check if the ground truth label value is included in the topi prediction.</span></div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <span class="comment">// Note that a prediction can have multiple prediction labels.</span></div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <span class="keyword">const</span> <a class="code" href="namespacearmnn_utils.xhtml#ab175d8bf2482d5a39c2331d1f0ddcece">LabelCategoryNames</a> predictionLabels = m_ModelOutputLabels[<span class="keyword">static_cast<</span><span class="keywordtype">size_t</span><span class="keyword">></span>(element.first)];</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="keywordflow">if</span> (std::find(predictionLabels.begin(), predictionLabels.end(), correctLabel) != predictionLabels.end())</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  {</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  ++m_TopK[index];</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  }</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  ++index;</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  }</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  }</div><div class="ttc" id="namespacearmnn_utils_xhtml_ab175d8bf2482d5a39c2331d1f0ddcece"><div class="ttname"><a href="namespacearmnn_utils.xhtml#ab175d8bf2482d5a39c2331d1f0ddcece">armnnUtils::LabelCategoryNames</a></div><div class="ttdeci">std::vector< std::string > LabelCategoryNames</div><div class="ttdef"><b>Definition:</b> <a href="_model_accuracy_checker_8hpp_source.xhtml#l00025">ModelAccuracyChecker.hpp:25</a></div></div> |
| 211 | </div><!-- fragment --> |
| 212 | </div> |
| 213 | </div> |
| 214 | <a id="ad6ddd3b77dd12eb33875d58a391b2412"></a> |
| 215 | <h2 class="memtitle"><span class="permalink"><a href="#ad6ddd3b77dd12eb33875d58a391b2412">◆ </a></span>GetAccuracy()</h2> |
| 216 | |
| 217 | <div class="memitem"> |
| 218 | <div class="memproto"> |
| 219 | <table class="memname"> |
| 220 | <tr> |
| 221 | <td class="memname">float GetAccuracy </td> |
| 222 | <td>(</td> |
| 223 | <td class="paramtype">unsigned int </td> |
| 224 | <td class="paramname"><em>k</em></td><td>)</td> |
| 225 | <td></td> |
| 226 | </tr> |
| 227 | </table> |
| 228 | </div><div class="memdoc"> |
| 229 | |
| 230 | <p>Get Top K accuracy. </p> |
| 231 | <dl class="params"><dt>Parameters</dt><dd> |
| 232 | <table class="params"> |
| 233 | <tr><td class="paramdir">[in]</td><td class="paramname">k</td><td>The number of top predictions to use for validating the ground-truth label. For example, if <code>k</code> is 3, then a prediction is considered correct as long as the ground-truth appears in the top 3 predictions. </td></tr> |
| 234 | </table> |
| 235 | </dd> |
| 236 | </dl> |
| 237 | <dl class="section return"><dt>Returns</dt><dd>The accuracy, according to the top <code>k</code> th predictions. </dd></dl> |
| 238 | |
| 239 | <p class="definition">Definition at line <a class="el" href="_model_accuracy_checker_8cpp_source.xhtml#l00023">23</a> of file <a class="el" href="_model_accuracy_checker_8cpp_source.xhtml">ModelAccuracyChecker.cpp</a>.</p> |
| 240 | |
| 241 | <p class="reference">References <a class="el" href="_logging_8hpp_source.xhtml#l00163">ARMNN_LOG</a>, and <a class="el" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">armnn::warning</a>.</p> |
| 242 | |
| 243 | <p class="reference">Referenced by <a class="el" href="_model_accuracy_checker_test_8cpp_source.xhtml#l00061">BOOST_FIXTURE_TEST_CASE()</a>.</p> |
| 244 | <div class="fragment"><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> {</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  <span class="keywordflow">if</span> (k > 10)</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  {</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  <a class="code" href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(warning) << <span class="stringliteral">"Accuracy Tool only supports a maximum of Top 10 Accuracy. "</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  <span class="stringliteral">"Printing Top 10 Accuracy result!"</span>;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  k = 10;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  }</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> total = 0;</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = k; i > 0; --i)</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  {</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  total += m_TopK[i];</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  }</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><span class="keywordtype">float</span><span class="keyword">></span>(total * 100) / static_cast<float>(m_ImagesProcessed);</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> }</div><div class="ttc" id="_logging_8hpp_xhtml_a7b6ad073975f437ec38ca7d20154727f"><div class="ttname"><a href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a></div><div class="ttdeci">#define ARMNN_LOG(severity)</div><div class="ttdef"><b>Definition:</b> <a href="_logging_8hpp_source.xhtml#l00163">Logging.hpp:163</a></div></div> |
| 245 | </div><!-- fragment --> |
| 246 | </div> |
| 247 | </div> |
| 248 | <hr/>The documentation for this class was generated from the following files:<ul> |
| 249 | <li>src/armnnUtils/<a class="el" href="_model_accuracy_checker_8hpp_source.xhtml">ModelAccuracyChecker.hpp</a></li> |
| 250 | <li>src/armnnUtils/<a class="el" href="_model_accuracy_checker_8cpp_source.xhtml">ModelAccuracyChecker.cpp</a></li> |
| 251 | </ul> |
| 252 | </div><!-- contents --> |
| 253 | </div><!-- doc-content --> |
| 254 | <!-- start footer part --> |
| 255 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 256 | <ul> |
| 257 | <li class="navelem"><a class="el" href="namespacearmnn_utils.xhtml">armnnUtils</a></li><li class="navelem"><a class="el" href="classarmnn_utils_1_1_model_accuracy_checker.xhtml">ModelAccuracyChecker</a></li> |
| 258 | <li class="footer">Generated on Fri Mar 13 2020 16:09:21 for ArmNN by |
| 259 | <a href="http://www.doxygen.org/index.html"> |
| 260 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 261 | </ul> |
| 262 | </div> |
| 263 | </body> |
| 264 | </html> |