Ryan OShea | de36e4a | 2020-03-13 16:26:19 +0000 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 5 | <meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| 6 | <meta name="generator" content="Doxygen 1.8.13"/> |
| 7 | <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 8 | <title>ArmNN: ClassifierTestCaseProvider< TDatabase, InferenceModel > Class Template Reference</title> |
| 9 | <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 10 | <script type="text/javascript" src="jquery.js"></script> |
| 11 | <script type="text/javascript" src="dynsections.js"></script> |
| 12 | <link href="navtree.css" rel="stylesheet" type="text/css"/> |
| 13 | <script type="text/javascript" src="resize.js"></script> |
| 14 | <script type="text/javascript" src="navtreedata.js"></script> |
| 15 | <script type="text/javascript" src="navtree.js"></script> |
| 16 | <script type="text/javascript"> |
| 17 | $(document).ready(initResizable); |
| 18 | </script> |
| 19 | <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| 20 | <script type="text/javascript" src="search/searchdata.js"></script> |
| 21 | <script type="text/javascript" src="search/search.js"></script> |
| 22 | <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 23 | </head> |
| 24 | <body> |
| 25 | <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 26 | <div id="titlearea"> |
| 27 | <table cellspacing="0" cellpadding="0"> |
| 28 | <tbody> |
| 29 | <tr style="height: 56px;"> |
| 30 | <td id="projectalign" style="padding-left: 0.5em;"> |
| 31 | <div id="projectname">ArmNN |
| 32 |  <span id="projectnumber">NotReleased</span> |
| 33 | </div> |
| 34 | </td> |
| 35 | </tr> |
| 36 | </tbody> |
| 37 | </table> |
| 38 | </div> |
| 39 | <!-- end header part --> |
| 40 | <!-- Generated by Doxygen 1.8.13 --> |
| 41 | <script type="text/javascript"> |
| 42 | var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| 43 | </script> |
| 44 | <script type="text/javascript" src="menudata.js"></script> |
| 45 | <script type="text/javascript" src="menu.js"></script> |
| 46 | <script type="text/javascript"> |
| 47 | $(function() { |
| 48 | initMenu('',true,false,'search.php','Search'); |
| 49 | $(document).ready(function() { init_search(); }); |
| 50 | }); |
| 51 | </script> |
| 52 | <div id="main-nav"></div> |
| 53 | </div><!-- top --> |
| 54 | <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| 55 | <div id="nav-tree"> |
| 56 | <div id="nav-tree-contents"> |
| 57 | <div id="nav-sync" class="sync"></div> |
| 58 | </div> |
| 59 | </div> |
| 60 | <div id="splitbar" style="-moz-user-select:none;" |
| 61 | class="ui-resizable-handle"> |
| 62 | </div> |
| 63 | </div> |
| 64 | <script type="text/javascript"> |
| 65 | $(document).ready(function(){initNavTree('classarmnn_1_1test_1_1_classifier_test_case_provider.html','');}); |
| 66 | </script> |
| 67 | <div id="doc-content"> |
| 68 | <!-- window showing the filter options --> |
| 69 | <div id="MSearchSelectWindow" |
| 70 | onmouseover="return searchBox.OnSearchSelectShow()" |
| 71 | onmouseout="return searchBox.OnSearchSelectHide()" |
| 72 | onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| 73 | </div> |
| 74 | |
| 75 | <!-- iframe showing the search results (closed by default) --> |
| 76 | <div id="MSearchResultsWindow"> |
| 77 | <iframe src="javascript:void(0)" frameborder="0" |
| 78 | name="MSearchResults" id="MSearchResults"> |
| 79 | </iframe> |
| 80 | </div> |
| 81 | |
| 82 | <div class="header"> |
| 83 | <div class="summary"> |
| 84 | <a href="#pub-methods">Public Member Functions</a> | |
| 85 | <a href="classarmnn_1_1test_1_1_classifier_test_case_provider-members.html">List of all members</a> </div> |
| 86 | <div class="headertitle"> |
| 87 | <div class="title">ClassifierTestCaseProvider< TDatabase, InferenceModel > Class Template Reference</div> </div> |
| 88 | </div><!--header--> |
| 89 | <div class="contents"> |
| 90 | |
| 91 | <p><code>#include <<a class="el" href="_inference_test_8hpp_source.html">InferenceTest.hpp</a>></code></p> |
| 92 | <div class="dynheader"> |
| 93 | Inheritance diagram for ClassifierTestCaseProvider< TDatabase, InferenceModel >:</div> |
| 94 | <div class="dyncontent"> |
| 95 | <div class="center"> |
| 96 | <img src="classarmnn_1_1test_1_1_classifier_test_case_provider.png" usemap="#ClassifierTestCaseProvider_3C_20TDatabase_2C_20InferenceModel_20_3E_map" alt=""/> |
| 97 | <map id="ClassifierTestCaseProvider_3C_20TDatabase_2C_20InferenceModel_20_3E_map" name="ClassifierTestCaseProvider_3C_20TDatabase_2C_20InferenceModel_20_3E_map"> |
| 98 | <area href="classarmnn_1_1test_1_1_i_inference_test_case_provider.html" alt="IInferenceTestCaseProvider" shape="rect" coords="0,0,348,24"/> |
| 99 | </map> |
| 100 | </div></div> |
| 101 | <table class="memberdecls"> |
| 102 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> |
| 103 | Public Member Functions</h2></td></tr> |
| 104 | <tr class="memitem:a566acf29d57266042a6169d5a9635599"><td class="memTemplParams" colspan="2">template<typename TConstructDatabaseCallable , typename TConstructModelCallable > </td></tr> |
| 105 | <tr class="memitem:a566acf29d57266042a6169d5a9635599"><td class="memTemplItemLeft" align="right" valign="top"> </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classarmnn_1_1test_1_1_classifier_test_case_provider.html#a566acf29d57266042a6169d5a9635599">ClassifierTestCaseProvider</a> (TConstructDatabaseCallable constructDatabase, TConstructModelCallable constructModel)</td></tr> |
| 106 | <tr class="separator:a566acf29d57266042a6169d5a9635599"><td class="memSeparator" colspan="2"> </td></tr> |
| 107 | <tr class="memitem:aa16e606c01629be4f9c261e5d09fa00a"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1test_1_1_classifier_test_case_provider.html#aa16e606c01629be4f9c261e5d09fa00a">AddCommandLineOptions</a> (boost::program_options::options_description &<a class="el" href="_file_only_profiling_decorator_tests_8cpp.html#a6560146509197f3e197d8d36f76c1347">options</a>) override</td></tr> |
| 108 | <tr class="separator:aa16e606c01629be4f9c261e5d09fa00a"><td class="memSeparator" colspan="2"> </td></tr> |
| 109 | <tr class="memitem:ad0077cdc7e406ec5e942e2a148edc077"><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1test_1_1_classifier_test_case_provider.html#ad0077cdc7e406ec5e942e2a148edc077">ProcessCommandLineOptions</a> (const <a class="el" href="structarmnn_1_1test_1_1_inference_test_options.html">InferenceTestOptions</a> &commonOptions) override</td></tr> |
| 110 | <tr class="separator:ad0077cdc7e406ec5e942e2a148edc077"><td class="memSeparator" colspan="2"> </td></tr> |
| 111 | <tr class="memitem:ab5ab4ef07d28ff282c5e3109deed810e"><td class="memItemLeft" align="right" valign="top">virtual std::unique_ptr< <a class="el" href="classarmnn_1_1test_1_1_i_inference_test_case.html">IInferenceTestCase</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1test_1_1_classifier_test_case_provider.html#ab5ab4ef07d28ff282c5e3109deed810e">GetTestCase</a> (unsigned int testCaseId) override</td></tr> |
| 112 | <tr class="separator:ab5ab4ef07d28ff282c5e3109deed810e"><td class="memSeparator" colspan="2"> </td></tr> |
| 113 | <tr class="memitem:a57a7735851dc40abdb1328e6f97f7b0f"><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1test_1_1_classifier_test_case_provider.html#a57a7735851dc40abdb1328e6f97f7b0f">OnInferenceTestFinished</a> () override</td></tr> |
| 114 | <tr class="separator:a57a7735851dc40abdb1328e6f97f7b0f"><td class="memSeparator" colspan="2"> </td></tr> |
| 115 | <tr class="inherit_header pub_methods_classarmnn_1_1test_1_1_i_inference_test_case_provider"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classarmnn_1_1test_1_1_i_inference_test_case_provider')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classarmnn_1_1test_1_1_i_inference_test_case_provider.html">IInferenceTestCaseProvider</a></td></tr> |
| 116 | <tr class="memitem:a63e4bc6c42594357e52b06e386b48d30 inherit pub_methods_classarmnn_1_1test_1_1_i_inference_test_case_provider"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1test_1_1_i_inference_test_case_provider.html#a63e4bc6c42594357e52b06e386b48d30">~IInferenceTestCaseProvider</a> ()</td></tr> |
| 117 | <tr class="separator:a63e4bc6c42594357e52b06e386b48d30 inherit pub_methods_classarmnn_1_1test_1_1_i_inference_test_case_provider"><td class="memSeparator" colspan="2"> </td></tr> |
| 118 | </table> |
| 119 | <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> |
| 120 | <div class="textblock"><h3>template<typename TDatabase, typename InferenceModel><br /> |
| 121 | class armnn::test::ClassifierTestCaseProvider< TDatabase, InferenceModel ></h3> |
| 122 | |
| 123 | |
| 124 | <p class="definition">Definition at line <a class="el" href="_inference_test_8hpp_source.html#l00176">176</a> of file <a class="el" href="_inference_test_8hpp_source.html">InferenceTest.hpp</a>.</p> |
| 125 | </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> |
| 126 | <a id="a566acf29d57266042a6169d5a9635599"></a> |
| 127 | <h2 class="memtitle"><span class="permalink"><a href="#a566acf29d57266042a6169d5a9635599">◆ </a></span>ClassifierTestCaseProvider()</h2> |
| 128 | |
| 129 | <div class="memitem"> |
| 130 | <div class="memproto"> |
| 131 | <table class="memname"> |
| 132 | <tr> |
| 133 | <td class="memname"><a class="el" href="classarmnn_1_1test_1_1_classifier_test_case_provider.html">ClassifierTestCaseProvider</a> </td> |
| 134 | <td>(</td> |
| 135 | <td class="paramtype">TConstructDatabaseCallable </td> |
| 136 | <td class="paramname"><em>constructDatabase</em>, </td> |
| 137 | </tr> |
| 138 | <tr> |
| 139 | <td class="paramkey"></td> |
| 140 | <td></td> |
| 141 | <td class="paramtype">TConstructModelCallable </td> |
| 142 | <td class="paramname"><em>constructModel</em> </td> |
| 143 | </tr> |
| 144 | <tr> |
| 145 | <td></td> |
| 146 | <td>)</td> |
| 147 | <td></td><td></td> |
| 148 | </tr> |
| 149 | </table> |
| 150 | </div><div class="memdoc"> |
| 151 | |
| 152 | <p class="definition">Definition at line <a class="el" href="_inference_test_8inl_source.html#l00175">175</a> of file <a class="el" href="_inference_test_8inl_source.html">InferenceTest.inl</a>.</p> |
| 153 | <div class="fragment"><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  : m_ConstructModel(constructModel)</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  , m_ConstructDatabase(constructDatabase)</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  , m_NumInferences(0)</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  , m_NumCorrectInferences(0)</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span> {</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span> }</div></div><!-- fragment --> |
| 154 | </div> |
| 155 | </div> |
| 156 | <h2 class="groupheader">Member Function Documentation</h2> |
| 157 | <a id="aa16e606c01629be4f9c261e5d09fa00a"></a> |
| 158 | <h2 class="memtitle"><span class="permalink"><a href="#aa16e606c01629be4f9c261e5d09fa00a">◆ </a></span>AddCommandLineOptions()</h2> |
| 159 | |
| 160 | <div class="memitem"> |
| 161 | <div class="memproto"> |
| 162 | <table class="mlabels"> |
| 163 | <tr> |
| 164 | <td class="mlabels-left"> |
| 165 | <table class="memname"> |
| 166 | <tr> |
| 167 | <td class="memname">void AddCommandLineOptions </td> |
| 168 | <td>(</td> |
| 169 | <td class="paramtype">boost::program_options::options_description & </td> |
| 170 | <td class="paramname"><em>options</em></td><td>)</td> |
| 171 | <td></td> |
| 172 | </tr> |
| 173 | </table> |
| 174 | </td> |
| 175 | <td class="mlabels-right"> |
| 176 | <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 177 | </tr> |
| 178 | </table> |
| 179 | </div><div class="memdoc"> |
| 180 | |
| 181 | <p>Reimplemented from <a class="el" href="classarmnn_1_1test_1_1_i_inference_test_case_provider.html#a27a71d8461ce2165add6978c34a625f1">IInferenceTestCaseProvider</a>.</p> |
| 182 | |
| 183 | <p class="definition">Definition at line <a class="el" href="_inference_test_8inl_source.html#l00185">185</a> of file <a class="el" href="_inference_test_8inl_source.html">InferenceTest.inl</a>.</p> |
| 184 | |
| 185 | <p class="reference">References <a class="el" href="_inference_model_8hpp_source.html#l00341">InferenceModel< IParser, TDataType >::AddCommandLineOptions()</a>.</p> |
| 186 | <div class="fragment"><div class="line"><a name="l00187"></a><span class="lineno"> 187</span> {</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <span class="keyword">namespace </span>po = boost::program_options;</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span> </div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  <a class="code" href="_file_only_profiling_decorator_tests_8cpp.html#a6560146509197f3e197d8d36f76c1347">options</a>.add_options()</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  (<span class="stringliteral">"validation-file-in"</span>, po::value<std::string>(&m_ValidationFileIn)->default_value(<span class="stringliteral">""</span>),</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="stringliteral">"Reads expected predictions from the given file and confirms they match the actual predictions."</span>)</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  (<span class="stringliteral">"validation-file-out"</span>, po::value<std::string>(&m_ValidationFileOut)->default_value(<span class="stringliteral">""</span>),</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <span class="stringliteral">"Predictions are saved to the given file for later use via --validation-file-in."</span>)</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  (<span class="stringliteral">"data-dir,d"</span>, po::value<std::string>(&m_DataDir)->required(),</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <span class="stringliteral">"Path to directory containing test data"</span>);</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span> </div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <a class="code" href="class_inference_model.html#afdd8d34e58b7a2dbf29e30d228c475a3">InferenceModel::AddCommandLineOptions</a>(<a class="code" href="_file_only_profiling_decorator_tests_8cpp.html#a6560146509197f3e197d8d36f76c1347">options</a>, m_ModelCommandLineOptions);</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span> }</div><div class="ttc" id="class_inference_model_html_afdd8d34e58b7a2dbf29e30d228c475a3"><div class="ttname"><a href="class_inference_model.html#afdd8d34e58b7a2dbf29e30d228c475a3">InferenceModel::AddCommandLineOptions</a></div><div class="ttdeci">static void AddCommandLineOptions(boost::program_options::options_description &desc, CommandLineOptions &options)</div><div class="ttdef"><b>Definition:</b> <a href="_inference_model_8hpp_source.html#l00341">InferenceModel.hpp:341</a></div></div> |
| 187 | <div class="ttc" id="_file_only_profiling_decorator_tests_8cpp_html_a6560146509197f3e197d8d36f76c1347"><div class="ttname"><a href="_file_only_profiling_decorator_tests_8cpp.html#a6560146509197f3e197d8d36f76c1347">options</a></div><div class="ttdeci">armnn::Runtime::CreationOptions::ExternalProfilingOptions options</div><div class="ttdef"><b>Definition:</b> <a href="_file_only_profiling_decorator_tests_8cpp_source.html#l00045">FileOnlyProfilingDecoratorTests.cpp:45</a></div></div> |
| 188 | </div><!-- fragment --> |
| 189 | </div> |
| 190 | </div> |
| 191 | <a id="ab5ab4ef07d28ff282c5e3109deed810e"></a> |
| 192 | <h2 class="memtitle"><span class="permalink"><a href="#ab5ab4ef07d28ff282c5e3109deed810e">◆ </a></span>GetTestCase()</h2> |
| 193 | |
| 194 | <div class="memitem"> |
| 195 | <div class="memproto"> |
| 196 | <table class="mlabels"> |
| 197 | <tr> |
| 198 | <td class="mlabels-left"> |
| 199 | <table class="memname"> |
| 200 | <tr> |
| 201 | <td class="memname">std::unique_ptr< <a class="el" href="classarmnn_1_1test_1_1_i_inference_test_case.html">IInferenceTestCase</a> > GetTestCase </td> |
| 202 | <td>(</td> |
| 203 | <td class="paramtype">unsigned int </td> |
| 204 | <td class="paramname"><em>testCaseId</em></td><td>)</td> |
| 205 | <td></td> |
| 206 | </tr> |
| 207 | </table> |
| 208 | </td> |
| 209 | <td class="mlabels-right"> |
| 210 | <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 211 | </tr> |
| 212 | </table> |
| 213 | </div><div class="memdoc"> |
| 214 | |
| 215 | <p>Implements <a class="el" href="classarmnn_1_1test_1_1_i_inference_test_case_provider.html#a04734602cd9aa5125174458128b3b418">IInferenceTestCaseProvider</a>.</p> |
| 216 | |
| 217 | <p class="definition">Definition at line <a class="el" href="_inference_test_8inl_source.html#l00229">229</a> of file <a class="el" href="_inference_test_8inl_source.html">InferenceTest.inl</a>.</p> |
| 218 | <div class="fragment"><div class="line"><a name="l00230"></a><span class="lineno"> 230</span> {</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  std::unique_ptr<typename TDatabase::TTestCaseData> testCaseData = m_Database->GetTestCaseData(testCaseId);</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  <span class="keywordflow">if</span> (testCaseData == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  {</div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  }</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span> </div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  <span class="keywordflow">return</span> std::make_unique<ClassifierTestCase<TDatabase, InferenceModel>>(</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  m_NumInferences,</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  m_NumCorrectInferences,</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  m_ValidationPredictions,</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  m_ValidationFileOut.empty() ? nullptr : &m_ValidationPredictionsOut,</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  *m_Model,</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  testCaseId,</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  testCaseData->m_Label,</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  std::move(testCaseData->m_InputImage));</div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span> }</div></div><!-- fragment --> |
| 219 | </div> |
| 220 | </div> |
| 221 | <a id="a57a7735851dc40abdb1328e6f97f7b0f"></a> |
| 222 | <h2 class="memtitle"><span class="permalink"><a href="#a57a7735851dc40abdb1328e6f97f7b0f">◆ </a></span>OnInferenceTestFinished()</h2> |
| 223 | |
| 224 | <div class="memitem"> |
| 225 | <div class="memproto"> |
| 226 | <table class="mlabels"> |
| 227 | <tr> |
| 228 | <td class="mlabels-left"> |
| 229 | <table class="memname"> |
| 230 | <tr> |
| 231 | <td class="memname">bool OnInferenceTestFinished </td> |
| 232 | <td>(</td> |
| 233 | <td class="paramname"></td><td>)</td> |
| 234 | <td></td> |
| 235 | </tr> |
| 236 | </table> |
| 237 | </td> |
| 238 | <td class="mlabels-right"> |
| 239 | <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 240 | </tr> |
| 241 | </table> |
| 242 | </div><div class="memdoc"> |
| 243 | |
| 244 | <p>Reimplemented from <a class="el" href="classarmnn_1_1test_1_1_i_inference_test_case_provider.html#a88bbd5a851f1148bf5a90db7779be261">IInferenceTestCaseProvider</a>.</p> |
| 245 | |
| 246 | <p class="definition">Definition at line <a class="el" href="_inference_test_8inl_source.html#l00249">249</a> of file <a class="el" href="_inference_test_8inl_source.html">InferenceTest.inl</a>.</p> |
| 247 | |
| 248 | <p class="reference">References <a class="el" href="_logging_8hpp_source.html#l00163">ARMNN_LOG</a>, <a class="el" href="namespacearmnn.html#a4dc0adc6737b5944e7671bee71788407acb5e100e5a9a3e7f6d1fd97512215282">armnn::error</a>, and <a class="el" href="namespacearmnn.html#a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c">armnn::info</a>.</p> |
| 249 | <div class="fragment"><div class="line"><a name="l00250"></a><span class="lineno"> 250</span> {</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  <span class="keyword">const</span> <span class="keywordtype">double</span> accuracy = boost::numeric_cast<<span class="keywordtype">double</span>>(m_NumCorrectInferences) /</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  boost::numeric_cast<double>(m_NumInferences);</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  <a class="code" href="_logging_8hpp.html#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(info) << std::fixed << std::setprecision(3) << <span class="stringliteral">"Overall accuracy: "</span> << accuracy;</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span> </div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  <span class="comment">// If a validation file was requested as output, the predictions are saved to it.</span></div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  <span class="keywordflow">if</span> (!m_ValidationFileOut.empty())</div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  {</div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  std::ofstream validationFileOut(m_ValidationFileOut.c_str(), std::ios_base::trunc | std::ios_base::out);</div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  <span class="keywordflow">if</span> (validationFileOut.good())</div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  {</div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> prediction : m_ValidationPredictionsOut)</div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  {</div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  validationFileOut << prediction << std::endl;</div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  }</div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  }</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  {</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  <a class="code" href="_logging_8hpp.html#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(error) << <span class="stringliteral">"Failed to open output validation file: "</span> << m_ValidationFileOut;</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  }</div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  }</div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span> </div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span> }</div><div class="ttc" id="_logging_8hpp_html_a7b6ad073975f437ec38ca7d20154727f"><div class="ttname"><a href="_logging_8hpp.html#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a></div><div class="ttdeci">#define ARMNN_LOG(severity)</div><div class="ttdef"><b>Definition:</b> <a href="_logging_8hpp_source.html#l00163">Logging.hpp:163</a></div></div> |
| 250 | </div><!-- fragment --> |
| 251 | </div> |
| 252 | </div> |
| 253 | <a id="ad0077cdc7e406ec5e942e2a148edc077"></a> |
| 254 | <h2 class="memtitle"><span class="permalink"><a href="#ad0077cdc7e406ec5e942e2a148edc077">◆ </a></span>ProcessCommandLineOptions()</h2> |
| 255 | |
| 256 | <div class="memitem"> |
| 257 | <div class="memproto"> |
| 258 | <table class="mlabels"> |
| 259 | <tr> |
| 260 | <td class="mlabels-left"> |
| 261 | <table class="memname"> |
| 262 | <tr> |
| 263 | <td class="memname">bool ProcessCommandLineOptions </td> |
| 264 | <td>(</td> |
| 265 | <td class="paramtype">const <a class="el" href="structarmnn_1_1test_1_1_inference_test_options.html">InferenceTestOptions</a> & </td> |
| 266 | <td class="paramname"><em>commonOptions</em></td><td>)</td> |
| 267 | <td></td> |
| 268 | </tr> |
| 269 | </table> |
| 270 | </td> |
| 271 | <td class="mlabels-right"> |
| 272 | <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 273 | </tr> |
| 274 | </table> |
| 275 | </div><div class="memdoc"> |
| 276 | |
| 277 | <p>Reimplemented from <a class="el" href="classarmnn_1_1test_1_1_i_inference_test_case_provider.html#a0b5cdedc222fce2b18000949f0699880">IInferenceTestCaseProvider</a>.</p> |
| 278 | |
| 279 | <p class="definition">Definition at line <a class="el" href="_inference_test_8inl_source.html#l00202">202</a> of file <a class="el" href="_inference_test_8inl_source.html">InferenceTest.inl</a>.</p> |
| 280 | |
| 281 | <p class="reference">References <a class="el" href="_inference_test_8cpp_source.html#l00092">armnn::test::ValidateDirectory()</a>.</p> |
| 282 | <div class="fragment"><div class="line"><a name="l00204"></a><span class="lineno"> 204</span> {</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  <span class="keywordflow">if</span> (!<a class="code" href="namespacearmnn_1_1test.html#a8a678fb3a8864e31aeb77f857ae6fc43">ValidateDirectory</a>(m_DataDir))</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  {</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  }</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span> </div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  ReadPredictions();</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span> </div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  m_Model = m_ConstructModel(commonOptions, m_ModelCommandLineOptions);</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  <span class="keywordflow">if</span> (!m_Model)</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  {</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  }</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span> </div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  m_Database = std::make_unique<TDatabase>(m_ConstructDatabase(m_DataDir.c_str(), *m_Model));</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  <span class="keywordflow">if</span> (!m_Database)</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  {</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  }</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span> </div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span> }</div><div class="ttc" id="namespacearmnn_1_1test_html_a8a678fb3a8864e31aeb77f857ae6fc43"><div class="ttname"><a href="namespacearmnn_1_1test.html#a8a678fb3a8864e31aeb77f857ae6fc43">armnn::test::ValidateDirectory</a></div><div class="ttdeci">bool ValidateDirectory(std::string &dir)</div><div class="ttdef"><b>Definition:</b> <a href="_inference_test_8cpp_source.html#l00092">InferenceTest.cpp:92</a></div></div> |
| 283 | </div><!-- fragment --> |
| 284 | </div> |
| 285 | </div> |
| 286 | <hr/>The documentation for this class was generated from the following files:<ul> |
| 287 | <li>tests/<a class="el" href="_inference_test_8hpp_source.html">InferenceTest.hpp</a></li> |
| 288 | <li>tests/<a class="el" href="_inference_test_8inl_source.html">InferenceTest.inl</a></li> |
| 289 | </ul> |
| 290 | </div><!-- contents --> |
| 291 | </div><!-- doc-content --> |
| 292 | <!-- start footer part --> |
| 293 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 294 | <ul> |
| 295 | <li class="navelem"><a class="el" href="namespacearmnn.html">armnn</a></li><li class="navelem"><a class="el" href="namespacearmnn_1_1test.html">test</a></li><li class="navelem"><a class="el" href="classarmnn_1_1test_1_1_classifier_test_case_provider.html">ClassifierTestCaseProvider</a></li> |
| 296 | <li class="footer">Generated on Fri Mar 13 2020 16:07:06 for ArmNN by |
| 297 | <a href="http://www.doxygen.org/index.html"> |
| 298 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 299 | </ul> |
| 300 | </div> |
| 301 | </body> |
| 302 | </html> |