neuralpp/doc/html/classneuralpp_1_1Layer.html

351 lines
16 KiB
HTML
Raw Normal View History

2009-08-09 11:17:39 +02:00
<!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::Layer 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&nbsp;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>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
<div class="navpath"><a class="el" href="namespaceneuralpp.html">neuralpp</a>::<a class="el" href="classneuralpp_1_1Layer.html">Layer</a>
</div>
</div>
<div class="contents">
<h1>neuralpp::Layer Class Reference</h1><!-- doxytag: class="neuralpp::Layer" -->Class for managing layers of neurons.
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="neural_09_09_8hpp-source.html">neural++.hpp</a>&gt;</code>
<p>
<p>
<a href="classneuralpp_1_1Layer-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 Member Functions</h2></td></tr>
2009-08-15 02:59:09 +02:00
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1Layer.html#fb08bddd85d36570dabfe915461f07c5">Layer</a> (size_t sz, double(*a)(double))</td></tr>
2009-08-09 11:17:39 +02:00
2009-08-15 02:59:09 +02:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor. <a href="#fb08bddd85d36570dabfe915461f07c5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1Layer.html#609ed16b8d79dc384b01ba7d16b72bd1">Layer</a> (vector&lt; <a class="el" href="classneuralpp_1_1Neuron.html">Neuron</a> &gt; &amp;neurons, double(*a)(double))</td></tr>
2009-08-09 11:17:39 +02:00
2009-08-15 02:59:09 +02:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Alternative constructor. <a href="#609ed16b8d79dc384b01ba7d16b72bd1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classneuralpp_1_1Neuron.html">Neuron</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1Layer.html#45ff7554830558155c6fbce3b6827122">operator[]</a> (size_t i) throw (NetworkIndexOutOfBoundsException)</td></tr>
2009-08-09 11:17:39 +02:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Redefinition for operator []. <a href="#45ff7554830558155c6fbce3b6827122"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1Layer.html#ac33444fde14633fa1ad4acb024ad150">link</a> (<a class="el" href="classneuralpp_1_1Layer.html">Layer</a> &amp;l)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">It links a layer to another. <a href="#ac33444fde14633fa1ad4acb024ad150"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1Layer.html#dbad95f635343a2998794113d7762cf7">setProp</a> (vector&lt; double &gt; &amp;v)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">It sets a vector of propagation values to all its neurons. <a href="#dbad95f635343a2998794113d7762cf7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1Layer.html#98f79281b680b1d18fd91fa5794c0899">setActv</a> (vector&lt; double &gt; &amp;v)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">It sets a vector of activation values to all its neurons. <a href="#98f79281b680b1d18fd91fa5794c0899"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1Layer.html#fcfd306039dbaf91c9e2dcc8fc1f1ce1">propagate</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">It propagates its activation values to the output layers. <a href="#fcfd306039dbaf91c9e2dcc8fc1f1ce1"></a><br></td></tr>
2009-08-15 02:59:09 +02:00
<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1Layer.html#7ca71ed62fbe9c1e9c0fb6a8dcaf76f0">size</a> () const </td></tr>
2009-08-09 11:17:39 +02:00
<tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">vector&lt; <a class="el" href="classneuralpp_1_1Neuron.html">Neuron</a> &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1Layer.html#855685c9da56b06b629e13a2f8c719ce">elements</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1Layer.html#c023a15a16353d0b4f44060a159f550f">update_weights</a> )()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">double(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1Layer.html#824367da29f92253a027a7c5b4a4405e">actv_f</a> )(double)</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Class for managing layers of neurons.
<p>
Don't use this class directly unless you know what you're doing, use <a class="el" href="classneuralpp_1_1NeuralNet.html" title="Main project&#39;s class.">NeuralNet</a> instead <hr><h2>Constructor &amp; Destructor Documentation</h2>
2009-08-15 02:59:09 +02:00
<a class="anchor" name="fb08bddd85d36570dabfe915461f07c5"></a><!-- doxytag: member="neuralpp::Layer::Layer" ref="fb08bddd85d36570dabfe915461f07c5" args="(size_t sz, double(*a)(double))" -->
2009-08-09 11:17:39 +02:00
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">neuralpp::Layer::Layer </td>
<td>(</td>
<td class="paramtype">size_t&nbsp;</td>
<td class="paramname"> <em>sz</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double(*)(double)&nbsp;</td>
2009-08-15 02:59:09 +02:00
<td class="paramname"> <em>a</em></td><td>&nbsp;</td>
2009-08-09 11:17:39 +02:00
</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>sz</em>&nbsp;</td><td>Size of the layer </td></tr>
<tr><td valign="top"></td><td valign="top"><em>a</em>&nbsp;</td><td>Activation function </td></tr>
</table>
</dl>
</div>
</div><p>
2009-08-15 02:59:09 +02:00
<a class="anchor" name="609ed16b8d79dc384b01ba7d16b72bd1"></a><!-- doxytag: member="neuralpp::Layer::Layer" ref="609ed16b8d79dc384b01ba7d16b72bd1" args="(vector&lt; Neuron &gt; &amp;neurons, double(*a)(double))" -->
2009-08-09 11:17:39 +02:00
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">neuralpp::Layer::Layer </td>
<td>(</td>
<td class="paramtype">vector&lt; <a class="el" href="classneuralpp_1_1Neuron.html">Neuron</a> &gt; &amp;&nbsp;</td>
<td class="paramname"> <em>neurons</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double(*)(double)&nbsp;</td>
2009-08-15 02:59:09 +02:00
<td class="paramname"> <em>a</em></td><td>&nbsp;</td>
2009-08-09 11:17:39 +02:00
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Alternative constructor.
<p>
It directly gets a vector of neurons to build the layer <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>neurons</em>&nbsp;</td><td>Vector of neurons to be included in the layer </td></tr>
<tr><td valign="top"></td><td valign="top"><em>a</em>&nbsp;</td><td>Activation function </td></tr>
</table>
</dl>
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="45ff7554830558155c6fbce3b6827122"></a><!-- doxytag: member="neuralpp::Layer::operator[]" ref="45ff7554830558155c6fbce3b6827122" args="(size_t i)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classneuralpp_1_1Neuron.html">Neuron</a>&amp; neuralpp::Layer::operator[] </td>
<td>(</td>
<td class="paramtype">size_t&nbsp;</td>
<td class="paramname"> <em>i</em> </td>
<td>&nbsp;)&nbsp;</td>
2009-08-15 02:59:09 +02:00
<td> throw (NetworkIndexOutOfBoundsException)</td>
2009-08-09 11:17:39 +02:00
</tr>
</table>
</div>
<div class="memdoc">
<p>
Redefinition for operator [].
<p>
It gets the neuron at <em>i</em> <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>i</em>&nbsp;</td><td>Index of the neuron to get in the layer </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Reference to the i-th neuron </dd></dl>
</div>
</div><p>
<a class="anchor" name="ac33444fde14633fa1ad4acb024ad150"></a><!-- doxytag: member="neuralpp::Layer::link" ref="ac33444fde14633fa1ad4acb024ad150" args="(Layer &amp;l)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void neuralpp::Layer::link </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classneuralpp_1_1Layer.html">Layer</a> &amp;&nbsp;</td>
<td class="paramname"> <em>l</em> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
It links a layer to another.
<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>l</em>&nbsp;</td><td><a class="el" href="classneuralpp_1_1Layer.html" title="Class for managing layers of neurons.">Layer</a> to connect to the current as input layer </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="dbad95f635343a2998794113d7762cf7"></a><!-- doxytag: member="neuralpp::Layer::setProp" ref="dbad95f635343a2998794113d7762cf7" args="(vector&lt; double &gt; &amp;v)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void neuralpp::Layer::setProp </td>
<td>(</td>
<td class="paramtype">vector&lt; double &gt; &amp;&nbsp;</td>
<td class="paramname"> <em>v</em> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
It sets a vector of propagation values to all its neurons.
<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>&nbsp;</td><td>Vector of values to write as propagation values </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="98f79281b680b1d18fd91fa5794c0899"></a><!-- doxytag: member="neuralpp::Layer::setActv" ref="98f79281b680b1d18fd91fa5794c0899" args="(vector&lt; double &gt; &amp;v)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void neuralpp::Layer::setActv </td>
<td>(</td>
<td class="paramtype">vector&lt; double &gt; &amp;&nbsp;</td>
<td class="paramname"> <em>v</em> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
It sets a vector of activation values to all its neurons.
<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>&nbsp;</td><td>Vector of values to write as activation values </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="fcfd306039dbaf91c9e2dcc8fc1f1ce1"></a><!-- doxytag: member="neuralpp::Layer::propagate" ref="fcfd306039dbaf91c9e2dcc8fc1f1ce1" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void neuralpp::Layer::propagate </td>
<td>(</td>
<td class="paramname"> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
It propagates its activation values to the output layers.
<p>
</div>
</div><p>
2009-08-15 02:59:09 +02:00
<a class="anchor" name="7ca71ed62fbe9c1e9c0fb6a8dcaf76f0"></a><!-- doxytag: member="neuralpp::Layer::size" ref="7ca71ed62fbe9c1e9c0fb6a8dcaf76f0" args="() const " -->
2009-08-09 11:17:39 +02:00
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t neuralpp::Layer::size </td>
<td>(</td>
<td class="paramname"> </td>
<td>&nbsp;)&nbsp;</td>
2009-08-15 02:59:09 +02:00
<td> const</td>
2009-08-09 11:17:39 +02:00
</tr>
</table>
</div>
<div class="memdoc">
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Number of neurons in the layer </dd></dl>
</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="855685c9da56b06b629e13a2f8c719ce"></a><!-- doxytag: member="neuralpp::Layer::elements" ref="855685c9da56b06b629e13a2f8c719ce" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">vector&lt;<a class="el" href="classneuralpp_1_1Neuron.html">Neuron</a>&gt; <a class="el" href="classneuralpp_1_1Layer.html#855685c9da56b06b629e13a2f8c719ce">neuralpp::Layer::elements</a><code> [private]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="c023a15a16353d0b4f44060a159f550f"></a><!-- doxytag: member="neuralpp::Layer::update_weights" ref="c023a15a16353d0b4f44060a159f550f" args=")()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void(* <a class="el" href="classneuralpp_1_1Layer.html#c023a15a16353d0b4f44060a159f550f">neuralpp::Layer::update_weights</a>)()<code> [private]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="824367da29f92253a027a7c5b4a4405e"></a><!-- doxytag: member="neuralpp::Layer::actv_f" ref="824367da29f92253a027a7c5b4a4405e" args=")(double)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double(* <a class="el" href="classneuralpp_1_1Layer.html#824367da29f92253a027a7c5b4a4405e">neuralpp::Layer::actv_f</a>)(double)<code> [private]</code> </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>
2009-08-15 02:59:09 +02:00
<hr size="1"><address style="text-align: right;"><small>Generated on Sat Aug 15 02:56:02 2009 for Neural++ by&nbsp;
2009-08-09 11:17:39 +02:00
<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>