Skip to content

Commit

Permalink
Upgraded Diwa documentation pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Mar 24, 2024
1 parent cf878f9 commit 82d083b
Show file tree
Hide file tree
Showing 22 changed files with 238 additions and 278 deletions.
6 changes: 2 additions & 4 deletions docs/class_diwa-members.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,8 @@
<tr class="odd"><td class="entry"><a class="el" href="class_diwa.html#a410c77ad562f6e49f9d79c4fde37ac3d">getActivationFunction</a>() const</td><td class="entry"><a class="el" href="class_diwa.html">Diwa</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_diwa.html#a0677924dfd094ccc8f295feb896d96a7">inference</a>(double *inputs)</td><td class="entry"><a class="el" href="class_diwa.html">Diwa</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="class_diwa.html#a9647345843529f26c7ec3959697d73e0">initialize</a>(int inputNeurons, int hiddenLayers, int hiddenNeurons, int outputNeurons, bool randomizeWeights=true)</td><td class="entry"><a class="el" href="class_diwa.html">Diwa</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_diwa.html#a371512f843adf6d0ea6c70581224d311">loadFromFile</a>(std::ifstream &amp;annFile)</td><td class="entry"><a class="el" href="class_diwa.html">Diwa</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="class_diwa.html#a8777a2d67f101047f7dfd6fb3d92bb01">recommendedHiddenLayerCount</a>(int numSamples, int alpha)</td><td class="entry"><a class="el" href="class_diwa.html">Diwa</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_diwa.html#aee7f6dd835f93a7c88e890e5f329ccb6">recommendedHiddenNeuronCount</a>()</td><td class="entry"><a class="el" href="class_diwa.html">Diwa</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="class_diwa.html#aafbb6e742fabf31fe09fa9d3158e558b">saveToFile</a>(std::ofstream &amp;annFile)</td><td class="entry"><a class="el" href="class_diwa.html">Diwa</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_diwa.html#a8777a2d67f101047f7dfd6fb3d92bb01">recommendedHiddenLayerCount</a>(int numSamples, int alpha)</td><td class="entry"><a class="el" href="class_diwa.html">Diwa</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="class_diwa.html#aee7f6dd835f93a7c88e890e5f329ccb6">recommendedHiddenNeuronCount</a>()</td><td class="entry"><a class="el" href="class_diwa.html">Diwa</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_diwa.html#ab8474411623a6e505b6472ed08cf442d">setActivationFunction</a>(diwa_activation activation)</td><td class="entry"><a class="el" href="class_diwa.html">Diwa</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="class_diwa.html#a513dc40d5b18567013ea84185c91089b">train</a>(double learningRate, double *inputNeurons, double *outputNeurons)</td><td class="entry"><a class="el" href="class_diwa.html">Diwa</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_diwa.html#a99a875efca6521c42d0a167b6d6d8d93">~Diwa</a>()</td><td class="entry"><a class="el" href="class_diwa.html">Diwa</a></td><td class="entry"></td></tr>
Expand Down
62 changes: 0 additions & 62 deletions docs/class_diwa.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,6 @@
<tr class="memitem:a513dc40d5b18567013ea84185c91089b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_diwa.html#a513dc40d5b18567013ea84185c91089b">train</a> (double learningRate, double *inputNeurons, double *outputNeurons)</td></tr>
<tr class="memdesc:a513dc40d5b18567013ea84185c91089b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Train the neural network using backpropagation. <br /></td></tr>
<tr class="separator:a513dc40d5b18567013ea84185c91089b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a371512f843adf6d0ea6c70581224d311"><td class="memItemLeft" align="right" valign="top"><a class="el" href="diwa_8h.html#a669df21efbcbba971edbc5d4e091061a">DiwaError</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_diwa.html#a371512f843adf6d0ea6c70581224d311">loadFromFile</a> (std::ifstream &amp;annFile)</td></tr>
<tr class="memdesc:a371512f843adf6d0ea6c70581224d311"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load neural network model from file in non-Arduino environment. <br /></td></tr>
<tr class="separator:a371512f843adf6d0ea6c70581224d311"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aafbb6e742fabf31fe09fa9d3158e558b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="diwa_8h.html#a669df21efbcbba971edbc5d4e091061a">DiwaError</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_diwa.html#aafbb6e742fabf31fe09fa9d3158e558b">saveToFile</a> (std::ofstream &amp;annFile)</td></tr>
<tr class="memdesc:aafbb6e742fabf31fe09fa9d3158e558b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Save neural network model to file in non-Arduino environment. <br /></td></tr>
<tr class="separator:aafbb6e742fabf31fe09fa9d3158e558b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a22d9a6ed4e81f2f9d6b6845f0d076866"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_diwa.html#a22d9a6ed4e81f2f9d6b6845f0d076866">calculateAccuracy</a> (double *testInput, double *testExpectedOutput, int epoch)</td></tr>
<tr class="memdesc:a22d9a6ed4e81f2f9d6b6845f0d076866"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates the accuracy of the neural network on test data. <br /></td></tr>
<tr class="separator:a22d9a6ed4e81f2f9d6b6845f0d076866"><td class="memSeparator" colspan="2">&#160;</td></tr>
Expand Down Expand Up @@ -392,34 +386,6 @@ <h2 class="memtitle"><span class="permalink"><a href="#a9647345843529f26c7ec3959
</dl>
<dl class="section return"><dt>Returns</dt><dd>DiwaError indicating the initialization status. </dd></dl>

</div>
</div>
<a id="a371512f843adf6d0ea6c70581224d311" name="a371512f843adf6d0ea6c70581224d311"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a371512f843adf6d0ea6c70581224d311">&#9670;&#160;</a></span>loadFromFile()</h2>

<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="diwa_8h.html#a669df21efbcbba971edbc5d4e091061a">DiwaError</a> Diwa::loadFromFile </td>
<td>(</td>
<td class="paramtype">std::ifstream &amp;&#160;</td>
<td class="paramname"><em>annFile</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">

<p>Load neural network model from file in non-Arduino environment. </p>
<p>This method loads a previously saved neural network model from the specified file in a non-Arduino environment. It reads the model data from the given file stream and initializes the <a class="el" href="class_diwa.html" title="Lightweight Feedforward Artificial Neural Network (ANN) library tailored for microcontrollers.">Diwa</a> object with the loaded model parameters and weights.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">annFile</td><td>Input file stream representing the neural network model file. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>DiwaError indicating the loading status. </dd></dl>

</div>
</div>
<a id="a8777a2d67f101047f7dfd6fb3d92bb01" name="a8777a2d67f101047f7dfd6fb3d92bb01"></a>
Expand Down Expand Up @@ -480,34 +446,6 @@ <h2 class="memtitle"><span class="permalink"><a href="#aee7f6dd835f93a7c88e890e5
<p>This function computes the recommended number of hidden neurons for a neural network based on the number of input and output neurons. The recommendation is calculated using a heuristic formula that aims to strike a balance between model complexity and generalization ability. The recommended number of hidden neurons is determined as the square root of the product of the input and output neurons.</p>
<dl class="section return"><dt>Returns</dt><dd>The recommended number of hidden neurons, or -1 if the input or output neurons are non-positive. </dd></dl>

</div>
</div>
<a id="aafbb6e742fabf31fe09fa9d3158e558b" name="aafbb6e742fabf31fe09fa9d3158e558b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aafbb6e742fabf31fe09fa9d3158e558b">&#9670;&#160;</a></span>saveToFile()</h2>

<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="diwa_8h.html#a669df21efbcbba971edbc5d4e091061a">DiwaError</a> Diwa::saveToFile </td>
<td>(</td>
<td class="paramtype">std::ofstream &amp;&#160;</td>
<td class="paramname"><em>annFile</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">

<p>Save neural network model to file in non-Arduino environment. </p>
<p>This method saves the current state of the neural network model to the specified file in a non-Arduino environment. It writes the model parameters and weights to the given file stream, facilitating storage and retrieval of the trained model.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">annFile</td><td>Output file stream representing the destination file for the model. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>DiwaError indicating the saving status. </dd></dl>

</div>
</div>
<a id="ab8474411623a6e505b6472ed08cf442d" name="ab8474411623a6e505b6472ed08cf442d"></a>
Expand Down
2 changes: 0 additions & 2 deletions docs/class_diwa.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ var class_diwa =
[ "getActivationFunction", "class_diwa.html#a410c77ad562f6e49f9d79c4fde37ac3d", null ],
[ "inference", "class_diwa.html#a0677924dfd094ccc8f295feb896d96a7", null ],
[ "initialize", "class_diwa.html#a9647345843529f26c7ec3959697d73e0", null ],
[ "loadFromFile", "class_diwa.html#a371512f843adf6d0ea6c70581224d311", null ],
[ "recommendedHiddenLayerCount", "class_diwa.html#a8777a2d67f101047f7dfd6fb3d92bb01", null ],
[ "recommendedHiddenNeuronCount", "class_diwa.html#aee7f6dd835f93a7c88e890e5f329ccb6", null ],
[ "saveToFile", "class_diwa.html#aafbb6e742fabf31fe09fa9d3158e558b", null ],
[ "setActivationFunction", "class_diwa.html#ab8474411623a6e505b6472ed08cf442d", null ],
[ "train", "class_diwa.html#a513dc40d5b18567013ea84185c91089b", null ]
];
4 changes: 1 addition & 3 deletions docs/diwa_8h.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,8 @@

<p>This file contains the declaration of the <a class="el" href="class_diwa.html" title="Lightweight Feedforward Artificial Neural Network (ANN) library tailored for microcontrollers.">Diwa</a> class, a lightweight Feedforward Artificial Neural Network (ANN) library tailored mainly for microcontrollers.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;fstream&gt;</code><br />
<div class="textblock"><code>#include &lt;<a class="el" href="diwa__activations_8h_source.html">diwa_activations.h</a>&gt;</code><br />
<code>#include &lt;stdint.h&gt;</code><br />
<code>#include &lt;<a class="el" href="diwa__activations_8h_source.html">diwa_activations.h</a>&gt;</code><br />
<code>#include &lt;math.h&gt;</code><br />
</div>
<p><a href="diwa_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
Expand Down
Loading

0 comments on commit 82d083b

Please sign in to comment.