mirror of
https://github.com/BlackLight/neuralpp.git
synced 2024-12-29 12:45:12 +01:00
981 lines
49 KiB
HTML
981 lines
49 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
|
<title>Neural++: neuralpp::NeuralNet Class Reference</title>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
|
<link href="tabs.css" rel="stylesheet" type="text/css">
|
|
</head><body>
|
|
<!-- Generated by Doxygen 1.5.6 -->
|
|
<div class="navigation" id="top">
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
|
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="annotated.html"><span>Class List</span></a></li>
|
|
<li><a href="functions.html"><span>Class Members</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="navpath"><a class="el" href="namespaceneuralpp.html">neuralpp</a>::<a class="el" href="classneuralpp_1_1NeuralNet.html">NeuralNet</a>
|
|
</div>
|
|
</div>
|
|
<div class="contents">
|
|
<h1>neuralpp::NeuralNet Class Reference</h1><!-- doxytag: class="neuralpp::NeuralNet" -->Main project's class.
|
|
<a href="#_details">More...</a>
|
|
<p>
|
|
<code>#include <<a class="el" href="neural_09_09_8hpp-source.html">neural++.hpp</a>></code>
|
|
<p>
|
|
|
|
<p>
|
|
<a href="classneuralpp_1_1NeuralNet-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
|
|
<tr><td></td></tr>
|
|
<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#94c36c94060e785ea67a0014c4182f8f">source</a> { <a class="el" href="classneuralpp_1_1NeuralNet.html#94c36c94060e785ea67a0014c4182f8f5ec2727c0756ddb097b53efe49b81afb">file</a>,
|
|
<a class="el" href="classneuralpp_1_1NeuralNet.html#94c36c94060e785ea67a0014c4182f8f6d06b4fe9414a158c97aee1a3679a904">str</a>
|
|
}</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Enum to choose the eventual training source for our network (XML from a file or from a string). <a href="classneuralpp_1_1NeuralNet.html#94c36c94060e785ea67a0014c4182f8f">More...</a><br></td></tr>
|
|
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#92b145f2f6f00bf1ba645ce2235882c2">NeuralNet</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Empty constructor for the class - it just makes nothing. <a href="#92b145f2f6f00bf1ba645ce2235882c2"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#3d602f3988a9a3e2c77dc6955674f412">NeuralNet</a> (size_t in_size, size_t hidden_size, size_t out_size, double l, int e, double th=0.0, double(*a)(double)=__actv)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#3d602f3988a9a3e2c77dc6955674f412"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#b4bfa407d28bb17abf7f735a049987d9">NeuralNet</a> (const std::string file) throw (NetworkFileNotFoundException)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#b4bfa407d28bb17abf7f735a049987d9"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#961dce8913264bf64c899dce4e25f810">getOutput</a> () const </td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">It gets the output of the network (note: the layer output should contain an only neuron). <a href="#961dce8913264bf64c899dce4e25f810"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#e08cdcf4b70f987700e553d9914f6179">getThreshold</a> () const </td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the threshold of the neurons in the network. <a href="#e08cdcf4b70f987700e553d9914f6179"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::vector< double > </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#e6d2215ecc8b560db2f6797db642191c">getOutputs</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">It gets the output of the network in case the output layer contains more neurons. <a href="#e6d2215ecc8b560db2f6797db642191c"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#562dfe9fb8d73bf25a23ce608451d3aa">expected</a> () const </td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the expected value (in case you have an only neuron in output layer). <a href="#562dfe9fb8d73bf25a23ce608451d3aa"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::vector< double > </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#51a1851ed07b85bec091c9053ae99cf7">getExpected</a> () const </td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the expected value (in case you have an only neuron in output layer). <a href="#51a1851ed07b85bec091c9053ae99cf7"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#b6475762b7e9eab086befdc511f7c236">setExpected</a> (double ex)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">It sets the value you expect from your network (in case the network has an only neuron in its output layer). <a href="#b6475762b7e9eab086befdc511f7c236"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#e649edc3d86bec7c0e178d5c892b4fd7">setExpected</a> (std::vector< double > ex)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the values you expect from your network. <a href="#e649edc3d86bec7c0e178d5c892b4fd7"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#b0bd1daadb06980dff1f50d33a7c098e">update</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">It updates through back-propagation the weights of the synapsis and computes again the output value for <em>epochs</em> times, calling back updateWeights and commitChanges functions. <a href="#b0bd1daadb06980dff1f50d33a7c098e"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#c129c180647362da963758bfd1ba6890">propagate</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">It propagates values through the network. <a href="#c129c180647362da963758bfd1ba6890"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#405b32d2928344314ecf0469070b0f17">setInput</a> (std::vector< double > v)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">It sets the input for the network. <a href="#405b32d2928344314ecf0469070b0f17"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#46f23f462318a4ffc037a4e806364c3f">link</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">It links the layers of the network (input, hidden, output). <a href="#46f23f462318a4ffc037a4e806364c3f"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#fdf94c276720c25e565cac834fe8a407">save</a> (const char *fname) throw (NetworkFileWriteException)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a trained neural network to a binary file. <a href="#fdf94c276720c25e565cac834fe8a407"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#1c9e17437d41a7048611e21a3cc1c7dd">train</a> (std::string xml, <a class="el" href="classneuralpp_1_1NeuralNet.html#94c36c94060e785ea67a0014c4182f8f">source</a> src) throw (InvalidXMLException)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Train a network using a training set loaded from an XML file. <a href="#1c9e17437d41a7048611e21a3cc1c7dd"></a><br></td></tr>
|
|
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#96da6712a72051cf34ad961761ef6e08">initXML</a> (std::string &xml)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize the training XML for the neural network. <a href="#96da6712a72051cf34ad961761ef6e08"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">static std::vector< double > </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#83c6555520856d5867752904349ab6ca">split</a> (char delim, std::string str)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Splits a string into a vector of doubles, given a delimitator. <a href="#83c6555520856d5867752904349ab6ca"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">static std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#0a2733037af912b3e6a10146e7b7172f">XMLFromSet</a> (int &id, std::string set)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get a training set from a string and copies it to an XML For example, these strings could be training sets for making sums: "2,3;5" - "5,6;11" - "2,2;4" - "4,5:9" This method called on the first string will return an XML such this: '<training id="0"><input id="0">2</input><input id="1">3</input><output id="0">5</output> &lt/training>'. <a href="#0a2733037af912b3e6a10146e7b7172f"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#e17732ed578bc4bd6032bfae58a5cf51">closeXML</a> (std::string &xml)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Closes an open XML document generated by "initXML" and "XMLFromSet". <a href="#e17732ed578bc4bd6032bfae58a5cf51"></a><br></td></tr>
|
|
<tr><td colspan="2"><br><h2>Public Attributes</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classneuralpp_1_1Layer.html">Layer</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#e2b4e8405f9d25edab395d61502bdba9">input</a></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classneuralpp_1_1Layer.html">Layer</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#bbdaa1b6c0a1a95d2b18cd25fda2a266">hidden</a></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classneuralpp_1_1Layer.html">Layer</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#fa9b2dbcbb39d0fc70f790ac24069a74">output</a></td></tr>
|
|
|
|
<tr><td colspan="2"><br><h2>Private Member Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#94169c89a7cd47122ab5dbf1d5c5e108">updateWeights</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">It updates the weights of the net's synapsis through back-propagation. <a href="#94169c89a7cd47122ab5dbf1d5c5e108"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#f697a8d9967ad8f03e5a16a42cd110c5">commitChanges</a> (<a class="el" href="classneuralpp_1_1Layer.html">Layer</a> &l)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">It commits the changes made by <a class="el" href="classneuralpp_1_1NeuralNet.html#94169c89a7cd47122ab5dbf1d5c5e108" title="It updates the weights of the net's synapsis through back-propagation.">updateWeights()</a> to the layer l. <a href="#f697a8d9967ad8f03e5a16a42cd110c5"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#8a140d28e6dd4097470c7c138801ad01">error</a> (double ex)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the error made on the expected result as squared deviance. <a href="#8a140d28e6dd4097470c7c138801ad01"></a><br></td></tr>
|
|
<tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#4cb52dae7b43d03fac73afca7b9f3a51">epochs</a></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#4f88106c9e542c39eac43b4ca1974a2a">ref_epochs</a></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#6bd7be443e46b2fdbf1da2edb8e611ab">l_rate</a></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#327dbfdd72b0a74293f8f29630525aa3">threshold</a></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::vector< double > </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#a9e4ff43427f56663739c4c7450de8ee">expect</a></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">double(* </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1NeuralNet.html#c1469e6afd87d85b82f14bc246f82457">actv_f</a> )(double)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Private pointer to function, containing the function to be used as activation function. <a href="#c1469e6afd87d85b82f14bc246f82457"></a><br></td></tr>
|
|
</table>
|
|
<hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
Main project's class.
|
|
<p>
|
|
Use *ONLY* this class, unless you know what you're doing <dl compact><dt><b>Examples: </b></dt><dd>
|
|
|
|
<p>
|
|
<a class="el" href="examples_2adderFromScratch_8cpp-example.html#_a0">examples/adderFromScratch.cpp</a>, <a class="el" href="examples_2doAdd_8cpp-example.html#_a0">examples/doAdd.cpp</a>, and <a class="el" href="examples_2learnAdd_8cpp-example.html#_a0">examples/learnAdd.cpp</a>.</dl><hr><h2>Member Enumeration Documentation</h2>
|
|
<a class="anchor" name="94c36c94060e785ea67a0014c4182f8f"></a><!-- doxytag: member="neuralpp::NeuralNet::source" ref="94c36c94060e785ea67a0014c4182f8f" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">enum <a class="el" href="classneuralpp_1_1NeuralNet.html#94c36c94060e785ea67a0014c4182f8f">neuralpp::NeuralNet::source</a> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Enum to choose the eventual training source for our network (XML from a file or from a string).
|
|
<p>
|
|
<dl compact><dt><b>Enumerator: </b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"><em><a class="anchor" name="94c36c94060e785ea67a0014c4182f8f5ec2727c0756ddb097b53efe49b81afb"></a><!-- doxytag: member="file" ref="94c36c94060e785ea67a0014c4182f8f5ec2727c0756ddb097b53efe49b81afb" args="" -->file</em> </td><td>
|
|
</td></tr>
|
|
<tr><td valign="top"><em><a class="anchor" name="94c36c94060e785ea67a0014c4182f8f6d06b4fe9414a158c97aee1a3679a904"></a><!-- doxytag: member="str" ref="94c36c94060e785ea67a0014c4182f8f6d06b4fe9414a158c97aee1a3679a904" args="" -->str</em> </td><td>
|
|
</td></tr>
|
|
</table>
|
|
</dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<hr><h2>Constructor & Destructor Documentation</h2>
|
|
<a class="anchor" name="92b145f2f6f00bf1ba645ce2235882c2"></a><!-- doxytag: member="neuralpp::NeuralNet::NeuralNet" ref="92b145f2f6f00bf1ba645ce2235882c2" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">neuralpp::NeuralNet::NeuralNet </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Empty constructor for the class - it just makes nothing.
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="3d602f3988a9a3e2c77dc6955674f412"></a><!-- doxytag: member="neuralpp::NeuralNet::NeuralNet" ref="3d602f3988a9a3e2c77dc6955674f412" args="(size_t in_size, size_t hidden_size, size_t out_size, double l, int e, double th=0.0, double(*a)(double)=__actv)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">neuralpp::NeuralNet::NeuralNet </td>
|
|
<td>(</td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>in_size</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>hidden_size</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>out_size</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double </td>
|
|
<td class="paramname"> <em>l</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>e</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double </td>
|
|
<td class="paramname"> <em>th</em> = <code>0.0</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double(*)(double) </td>
|
|
<td class="paramname"> <em>a</em> = <code>__actv</code></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Constructor.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>in_size</em> </td><td>Size of the input layer </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>hidden_size</em> </td><td>Size of the hidden layer </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>out_size</em> </td><td>Size of the output layer </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>l</em> </td><td>learn rate (get it after doing some experiments, but generally try to keep its value quite low to be more accurate) </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>e</em> </td><td>Epochs (cycles) to execute (the most you execute, the most the network can be accurate for its purpose) </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>th</em> </td><td>Threshold, value in [0,1] that establishes how much a neuron must be 'sensitive' on variations of the input values </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>a</em> </td><td>Activation function to use (default: f(x)=x) </td></tr>
|
|
</table>
|
|
</dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="b4bfa407d28bb17abf7f735a049987d9"></a><!-- doxytag: member="neuralpp::NeuralNet::NeuralNet" ref="b4bfa407d28bb17abf7f735a049987d9" args="(const std::string file)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">neuralpp::NeuralNet::NeuralNet </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const std::string </td>
|
|
<td class="paramname"> <em>file</em> </td>
|
|
<td> ) </td>
|
|
<td> throw (<a class="el" href="classneuralpp_1_1NetworkFileNotFoundException.html">NetworkFileNotFoundException</a>)</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Constructor.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>file</em> </td><td>Binary file containing a neural network previously saved by <a class="el" href="classneuralpp_1_1NeuralNet.html#fdf94c276720c25e565cac834fe8a407" title="Save a trained neural network to a binary file.">save()</a> method </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Exceptions:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em><a class="el" href="classneuralpp_1_1NetworkFileNotFoundException.html" title="Exception thrown when doing an attempt to load a network from an invalid file.">NetworkFileNotFoundException</a></em> </td><td></td></tr>
|
|
</table>
|
|
</dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<hr><h2>Member Function Documentation</h2>
|
|
<a class="anchor" name="94169c89a7cd47122ab5dbf1d5c5e108"></a><!-- doxytag: member="neuralpp::NeuralNet::updateWeights" ref="94169c89a7cd47122ab5dbf1d5c5e108" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void neuralpp::NeuralNet::updateWeights </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td><code> [private]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
It updates the weights of the net's synapsis through back-propagation.
|
|
<p>
|
|
In-class use only
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="f697a8d9967ad8f03e5a16a42cd110c5"></a><!-- doxytag: member="neuralpp::NeuralNet::commitChanges" ref="f697a8d9967ad8f03e5a16a42cd110c5" args="(Layer &l)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void neuralpp::NeuralNet::commitChanges </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classneuralpp_1_1Layer.html">Layer</a> & </td>
|
|
<td class="paramname"> <em>l</em> </td>
|
|
<td> ) </td>
|
|
<td><code> [private]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
It commits the changes made by <a class="el" href="classneuralpp_1_1NeuralNet.html#94169c89a7cd47122ab5dbf1d5c5e108" title="It updates the weights of the net's synapsis through back-propagation.">updateWeights()</a> to the layer l.
|
|
<p>
|
|
In-class use only <dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>l</em> </td><td><a class="el" href="classneuralpp_1_1Layer.html" title="Class for managing layers of neurons.">Layer</a> to commit the changes </td></tr>
|
|
</table>
|
|
</dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="8a140d28e6dd4097470c7c138801ad01"></a><!-- doxytag: member="neuralpp::NeuralNet::error" ref="8a140d28e6dd4097470c7c138801ad01" args="(double ex)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double neuralpp::NeuralNet::error </td>
|
|
<td>(</td>
|
|
<td class="paramtype">double </td>
|
|
<td class="paramname"> <em>ex</em> </td>
|
|
<td> ) </td>
|
|
<td><code> [private]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Get the error made on the expected result as squared deviance.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>ex</em> </td><td>Expected value </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Mean error </dd></dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="961dce8913264bf64c899dce4e25f810"></a><!-- doxytag: member="neuralpp::NeuralNet::getOutput" ref="961dce8913264bf64c899dce4e25f810" args="() const " -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double neuralpp::NeuralNet::getOutput </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
It gets the output of the network (note: the layer output should contain an only neuron).
|
|
<p>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The output value of the network </dd></dl>
|
|
<dl compact><dt><b>Examples: </b></dt><dd>
|
|
<a class="el" href="examples_2doAdd_8cpp-example.html#a5">examples/doAdd.cpp</a>.</dl>
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="e08cdcf4b70f987700e553d9914f6179"></a><!-- doxytag: member="neuralpp::NeuralNet::getThreshold" ref="e08cdcf4b70f987700e553d9914f6179" args="() const " -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double neuralpp::NeuralNet::getThreshold </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Get the threshold of the neurons in the network.
|
|
<p>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The threshold of the neurons </dd></dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="e6d2215ecc8b560db2f6797db642191c"></a><!-- doxytag: member="neuralpp::NeuralNet::getOutputs" ref="e6d2215ecc8b560db2f6797db642191c" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">std::vector<double> neuralpp::NeuralNet::getOutputs </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
It gets the output of the network in case the output layer contains more neurons.
|
|
<p>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>A vector containing the output values of the network </dd></dl>
|
|
<dl compact><dt><b>Examples: </b></dt><dd>
|
|
<a class="el" href="examples_2adderFromScratch_8cpp-example.html#a4">examples/adderFromScratch.cpp</a>.</dl>
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="562dfe9fb8d73bf25a23ce608451d3aa"></a><!-- doxytag: member="neuralpp::NeuralNet::expected" ref="562dfe9fb8d73bf25a23ce608451d3aa" args="() const " -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double neuralpp::NeuralNet::expected </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Get the expected value (in case you have an only neuron in output layer).
|
|
<p>
|
|
Of course you should specify this when you build your network by using setExpected. <dl class="return" compact><dt><b>Returns:</b></dt><dd>The expected output value for a certain training phase </dd></dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="51a1851ed07b85bec091c9053ae99cf7"></a><!-- doxytag: member="neuralpp::NeuralNet::getExpected" ref="51a1851ed07b85bec091c9053ae99cf7" args="() const " -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">std::vector<double> neuralpp::NeuralNet::getExpected </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Get the expected value (in case you have an only neuron in output layer).
|
|
<p>
|
|
Of course you should specify this when you build your network by using setExpected. <dl class="return" compact><dt><b>Returns:</b></dt><dd>The expected output value for a certain training phase </dd></dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="b6475762b7e9eab086befdc511f7c236"></a><!-- doxytag: member="neuralpp::NeuralNet::setExpected" ref="b6475762b7e9eab086befdc511f7c236" args="(double ex)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void neuralpp::NeuralNet::setExpected </td>
|
|
<td>(</td>
|
|
<td class="paramtype">double </td>
|
|
<td class="paramname"> <em>ex</em> </td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
It sets the value you expect from your network (in case the network has an only neuron in its output layer).
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>ex</em> </td><td>Expected output value </td></tr>
|
|
</table>
|
|
</dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="e649edc3d86bec7c0e178d5c892b4fd7"></a><!-- doxytag: member="neuralpp::NeuralNet::setExpected" ref="e649edc3d86bec7c0e178d5c892b4fd7" args="(std::vector< double > ex)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void neuralpp::NeuralNet::setExpected </td>
|
|
<td>(</td>
|
|
<td class="paramtype">std::vector< double > </td>
|
|
<td class="paramname"> <em>ex</em> </td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Set the values you expect from your network.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>ex</em> </td><td>Expected output values </td></tr>
|
|
</table>
|
|
</dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="b0bd1daadb06980dff1f50d33a7c098e"></a><!-- doxytag: member="neuralpp::NeuralNet::update" ref="b0bd1daadb06980dff1f50d33a7c098e" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void neuralpp::NeuralNet::update </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
It updates through back-propagation the weights of the synapsis and computes again the output value for <em>epochs</em> times, calling back updateWeights and commitChanges functions.
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="c129c180647362da963758bfd1ba6890"></a><!-- doxytag: member="neuralpp::NeuralNet::propagate" ref="c129c180647362da963758bfd1ba6890" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void neuralpp::NeuralNet::propagate </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
It propagates values through the network.
|
|
<p>
|
|
Use this when you want to give an already trained network some new values the get to the output <dl compact><dt><b>Examples: </b></dt><dd>
|
|
<a class="el" href="examples_2adderFromScratch_8cpp-example.html#a3">examples/adderFromScratch.cpp</a>, and <a class="el" href="examples_2doAdd_8cpp-example.html#a4">examples/doAdd.cpp</a>.</dl>
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="405b32d2928344314ecf0469070b0f17"></a><!-- doxytag: member="neuralpp::NeuralNet::setInput" ref="405b32d2928344314ecf0469070b0f17" args="(std::vector< double > v)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void neuralpp::NeuralNet::setInput </td>
|
|
<td>(</td>
|
|
<td class="paramtype">std::vector< double > </td>
|
|
<td class="paramname"> <em>v</em> </td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
It sets the input for the network.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>v</em> </td><td>Vector of doubles, containing the values to give to your network </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Examples: </b></dt><dd>
|
|
<a class="el" href="examples_2adderFromScratch_8cpp-example.html#a2">examples/adderFromScratch.cpp</a>, and <a class="el" href="examples_2doAdd_8cpp-example.html#a3">examples/doAdd.cpp</a>.</dl>
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="46f23f462318a4ffc037a4e806364c3f"></a><!-- doxytag: member="neuralpp::NeuralNet::link" ref="46f23f462318a4ffc037a4e806364c3f" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void neuralpp::NeuralNet::link </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
It links the layers of the network (input, hidden, output).
|
|
<p>
|
|
Don't use unless you exactly know what you're doing, it is already called by the constructor
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="fdf94c276720c25e565cac834fe8a407"></a><!-- doxytag: member="neuralpp::NeuralNet::save" ref="fdf94c276720c25e565cac834fe8a407" args="(const char *fname)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void neuralpp::NeuralNet::save </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>fname</em> </td>
|
|
<td> ) </td>
|
|
<td> throw (<a class="el" href="classneuralpp_1_1NetworkFileWriteException.html">NetworkFileWriteException</a>)</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Save a trained neural network to a binary file.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>fname</em> </td><td>Binary file where you're going to save your network </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Exceptions:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em><a class="el" href="classneuralpp_1_1NetworkFileWriteException.html" title="Exception thrown when trying to write the network's information to a file that...">NetworkFileWriteException</a></em> </td><td>When you get an error writing the network's information to a file </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Examples: </b></dt><dd>
|
|
<a class="el" href="examples_2learnAdd_8cpp-example.html#a2">examples/learnAdd.cpp</a>.</dl>
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="1c9e17437d41a7048611e21a3cc1c7dd"></a><!-- doxytag: member="neuralpp::NeuralNet::train" ref="1c9e17437d41a7048611e21a3cc1c7dd" args="(std::string xml, source src)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void neuralpp::NeuralNet::train </td>
|
|
<td>(</td>
|
|
<td class="paramtype">std::string </td>
|
|
<td class="paramname"> <em>xml</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="classneuralpp_1_1NeuralNet.html#94c36c94060e785ea67a0014c4182f8f">source</a> </td>
|
|
<td class="paramname"> <em>src</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td> throw (<a class="el" href="classneuralpp_1_1InvalidXMLException.html">InvalidXMLException</a>)</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Train a network using a training set loaded from an XML file.
|
|
<p>
|
|
A sample XML file is available in examples/adder.xml <dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>xml</em> </td><td>XML file containing our training set </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>src</em> </td><td>Source type from which the XML will be loaded (from a file [default] or from a string) </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Exceptions:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em><a class="el" href="classneuralpp_1_1InvalidXMLException.html" title="Exception thrown when trying parsing an invalid XML.">InvalidXMLException</a></em> </td><td></td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Examples: </b></dt><dd>
|
|
<a class="el" href="examples_2adderFromScratch_8cpp-example.html#a1">examples/adderFromScratch.cpp</a>, and <a class="el" href="examples_2learnAdd_8cpp-example.html#a1">examples/learnAdd.cpp</a>.</dl>
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="96da6712a72051cf34ad961761ef6e08"></a><!-- doxytag: member="neuralpp::NeuralNet::initXML" ref="96da6712a72051cf34ad961761ef6e08" args="(std::string &xml)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static void neuralpp::NeuralNet::initXML </td>
|
|
<td>(</td>
|
|
<td class="paramtype">std::string & </td>
|
|
<td class="paramname"> <em>xml</em> </td>
|
|
<td> ) </td>
|
|
<td><code> [static]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Initialize the training XML for the neural network.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>xml</em> </td><td>String that will contain the XML </td></tr>
|
|
</table>
|
|
</dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="83c6555520856d5867752904349ab6ca"></a><!-- doxytag: member="neuralpp::NeuralNet::split" ref="83c6555520856d5867752904349ab6ca" args="(char delim, std::string str)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static std::vector<double> neuralpp::NeuralNet::split </td>
|
|
<td>(</td>
|
|
<td class="paramtype">char </td>
|
|
<td class="paramname"> <em>delim</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">std::string </td>
|
|
<td class="paramname"> <em>str</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td><code> [static]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Splits a string into a vector of doubles, given a delimitator.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>delim</em> </td><td>Delimitator </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>str</em> </td><td>String to be splitted </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Vector of doubles containing splitted values </dd></dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="0a2733037af912b3e6a10146e7b7172f"></a><!-- doxytag: member="neuralpp::NeuralNet::XMLFromSet" ref="0a2733037af912b3e6a10146e7b7172f" args="(int &id, std::string set)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static std::string neuralpp::NeuralNet::XMLFromSet </td>
|
|
<td>(</td>
|
|
<td class="paramtype">int & </td>
|
|
<td class="paramname"> <em>id</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">std::string </td>
|
|
<td class="paramname"> <em>set</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td><code> [static]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Get a training set from a string and copies it to an XML For example, these strings could be training sets for making sums: "2,3;5" - "5,6;11" - "2,2;4" - "4,5:9" This method called on the first string will return an XML such this: '<training id="0"><input id="0">2</input><input id="1">3</input><output id="0">5</output> &lt/training>'.
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>id</em> </td><td>ID for the given training set (0,1,..,n) </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>set</em> </td><td>String containing input values and expected outputs </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>XML string </dd></dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="e17732ed578bc4bd6032bfae58a5cf51"></a><!-- doxytag: member="neuralpp::NeuralNet::closeXML" ref="e17732ed578bc4bd6032bfae58a5cf51" args="(std::string &xml)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static void neuralpp::NeuralNet::closeXML </td>
|
|
<td>(</td>
|
|
<td class="paramtype">std::string & </td>
|
|
<td class="paramname"> <em>xml</em> </td>
|
|
<td> ) </td>
|
|
<td><code> [static]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Closes an open XML document generated by "initXML" and "XMLFromSet".
|
|
<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>xml</em> </td><td>XML string to be closed </td></tr>
|
|
</table>
|
|
</dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<hr><h2>Member Data Documentation</h2>
|
|
<a class="anchor" name="4cb52dae7b43d03fac73afca7b9f3a51"></a><!-- doxytag: member="neuralpp::NeuralNet::epochs" ref="4cb52dae7b43d03fac73afca7b9f3a51" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int <a class="el" href="classneuralpp_1_1NeuralNet.html#4cb52dae7b43d03fac73afca7b9f3a51">neuralpp::NeuralNet::epochs</a><code> [private]</code> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="4f88106c9e542c39eac43b4ca1974a2a"></a><!-- doxytag: member="neuralpp::NeuralNet::ref_epochs" ref="4f88106c9e542c39eac43b4ca1974a2a" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int <a class="el" href="classneuralpp_1_1NeuralNet.html#4f88106c9e542c39eac43b4ca1974a2a">neuralpp::NeuralNet::ref_epochs</a><code> [private]</code> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="6bd7be443e46b2fdbf1da2edb8e611ab"></a><!-- doxytag: member="neuralpp::NeuralNet::l_rate" ref="6bd7be443e46b2fdbf1da2edb8e611ab" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double <a class="el" href="classneuralpp_1_1NeuralNet.html#6bd7be443e46b2fdbf1da2edb8e611ab">neuralpp::NeuralNet::l_rate</a><code> [private]</code> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="327dbfdd72b0a74293f8f29630525aa3"></a><!-- doxytag: member="neuralpp::NeuralNet::threshold" ref="327dbfdd72b0a74293f8f29630525aa3" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double <a class="el" href="classneuralpp_1_1NeuralNet.html#327dbfdd72b0a74293f8f29630525aa3">neuralpp::NeuralNet::threshold</a><code> [private]</code> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="a9e4ff43427f56663739c4c7450de8ee"></a><!-- doxytag: member="neuralpp::NeuralNet::expect" ref="a9e4ff43427f56663739c4c7450de8ee" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">std::vector<double> <a class="el" href="classneuralpp_1_1NeuralNet.html#a9e4ff43427f56663739c4c7450de8ee">neuralpp::NeuralNet::expect</a><code> [private]</code> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="c1469e6afd87d85b82f14bc246f82457"></a><!-- doxytag: member="neuralpp::NeuralNet::actv_f" ref="c1469e6afd87d85b82f14bc246f82457" args=")(double)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double(* <a class="el" href="classneuralpp_1_1NeuralNet.html#c1469e6afd87d85b82f14bc246f82457">neuralpp::NeuralNet::actv_f</a>)(double)<code> [private]</code> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Private pointer to function, containing the function to be used as activation function.
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="e2b4e8405f9d25edab395d61502bdba9"></a><!-- doxytag: member="neuralpp::NeuralNet::input" ref="e2b4e8405f9d25edab395d61502bdba9" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classneuralpp_1_1Layer.html">Layer</a>* <a class="el" href="classneuralpp_1_1NeuralNet.html#e2b4e8405f9d25edab395d61502bdba9">neuralpp::NeuralNet::input</a> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="bbdaa1b6c0a1a95d2b18cd25fda2a266"></a><!-- doxytag: member="neuralpp::NeuralNet::hidden" ref="bbdaa1b6c0a1a95d2b18cd25fda2a266" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classneuralpp_1_1Layer.html">Layer</a>* <a class="el" href="classneuralpp_1_1NeuralNet.html#bbdaa1b6c0a1a95d2b18cd25fda2a266">neuralpp::NeuralNet::hidden</a> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="fa9b2dbcbb39d0fc70f790ac24069a74"></a><!-- doxytag: member="neuralpp::NeuralNet::output" ref="fa9b2dbcbb39d0fc70f790ac24069a74" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classneuralpp_1_1Layer.html">Layer</a>* <a class="el" href="classneuralpp_1_1NeuralNet.html#fa9b2dbcbb39d0fc70f790ac24069a74">neuralpp::NeuralNet::output</a> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<hr>The documentation for this class was generated from the following file:<ul>
|
|
<li><a class="el" href="neural_09_09_8hpp-source.html">neural++.hpp</a></ul>
|
|
</div>
|
|
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Aug 16 20:53:42 2009 for Neural++ by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
|
|
</body>
|
|
</html>
|