neuralpp/doc/html/classneuralpp_1_1Layer.html

353 lines
16 KiB
HTML
Raw Permalink 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>
<li><a href="examples.html"><span>Examples</span></a></li>
2009-08-09 11:17:39 +02:00
</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>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1Layer.html#a235767701b5e9dcf28c5e9e0d04cb0b">Layer</a> (size_t sz, double(*a)(double), double th=0.0)</td></tr>
2009-08-09 11:17:39 +02:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor. <a href="#a235767701b5e9dcf28c5e9e0d04cb0b"></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#d79f684523f8a6e086b962c8eef37623">Layer</a> (std::vector&lt; <a class="el" href="classneuralpp_1_1Neuron.html">Neuron</a> &gt; &amp;neurons, double(*a)(double), double th=0.0)</td></tr>
2009-08-09 11:17:39 +02:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Alternative constructor. <a href="#d79f684523f8a6e086b962c8eef37623"></a><br></td></tr>
2009-08-15 02:59:09 +02:00
<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#88ceffc23f02a9dc24d4355767b7cca7">setInput</a> (std::vector&lt; double &gt; v)</td></tr>
2009-08-09 11:17:39 +02:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the input values for the neurons of the layer (just use it for the input layer). <a href="#88ceffc23f02a9dc24d4355767b7cca7"></a><br></td></tr>
2009-08-09 11:17:39 +02:00
<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">std::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#8188cb5c264e6021cee9979b968a0305">elements</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#02cf4efe1da02a7404d25375c85ed71f">threshold</a></td></tr>
2009-08-09 11:17:39 +02:00
<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>
<a class="anchor" name="a235767701b5e9dcf28c5e9e0d04cb0b"></a><!-- doxytag: member="neuralpp::Layer::Layer" ref="a235767701b5e9dcf28c5e9e0d04cb0b" args="(size_t sz, double(*a)(double), double th=0.0)" -->
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>
<td class="paramname"> <em>a</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double&nbsp;</td>
<td class="paramname"> <em>th</em> = <code>0.0</code></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>
<tr><td valign="top"></td><td valign="top"><em>th</em>&nbsp;</td><td>Threshold, value in [0,1] that establishes how much a neuron must be 'sensitive' on variations of the input values </td></tr>
2009-08-09 11:17:39 +02:00
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="d79f684523f8a6e086b962c8eef37623"></a><!-- doxytag: member="neuralpp::Layer::Layer" ref="d79f684523f8a6e086b962c8eef37623" args="(std::vector&lt; Neuron &gt; &amp;neurons, double(*a)(double), double th=0.0)" -->
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">std::vector&lt; <a class="el" href="classneuralpp_1_1Neuron.html">Neuron</a> &gt; &amp;&nbsp;</td>
2009-08-09 11:17:39 +02:00
<td class="paramname"> <em>neurons</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double(*)(double)&nbsp;</td>
<td class="paramname"> <em>a</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double&nbsp;</td>
<td class="paramname"> <em>th</em> = <code>0.0</code></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>
<tr><td valign="top"></td><td valign="top"><em>th</em>&nbsp;</td><td>Threshold, value in [0,1] that establishes how much a neuron must be 'sensitive' on variations of the input values </td></tr>
2009-08-09 11:17:39 +02:00
</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>
<td> throw (<a class="el" href="classneuralpp_1_1NetworkIndexOutOfBoundsException.html">NetworkIndexOutOfBoundsException</a>)</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="88ceffc23f02a9dc24d4355767b7cca7"></a><!-- doxytag: member="neuralpp::Layer::setInput" ref="88ceffc23f02a9dc24d4355767b7cca7" args="(std::vector&lt; double &gt; v)" -->
2009-08-09 11:17:39 +02:00
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void neuralpp::Layer::setInput </td>
2009-08-09 11:17:39 +02:00
<td>(</td>
<td class="paramtype">std::vector&lt; double &gt;&nbsp;</td>
2009-08-09 11:17:39 +02:00
<td class="paramname"> <em>v</em> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Set the input values for the neurons of the layer (just use it for the input layer).
2009-08-09 11:17:39 +02:00
<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 containing the input values </td></tr>
2009-08-09 11:17:39 +02:00
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="fcfd306039dbaf91c9e2dcc8fc1f1ce1"></a><!-- doxytag: member="neuralpp::Layer::propagate" ref="fcfd306039dbaf91c9e2dcc8fc1f1ce1" args="()" -->
2009-08-09 11:17:39 +02:00
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void neuralpp::Layer::propagate </td>
2009-08-09 11:17:39 +02:00
<td>(</td>
<td class="paramname"> </td>
2009-08-09 11:17:39 +02:00
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
It propagates its activation values to the output layers.
2009-08-09 11:17:39 +02:00
<p>
</div>
</div><p>
<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>
2009-08-09 11:17:39 +02:00
<td>(</td>
<td class="paramname"> </td>
<td>&nbsp;)&nbsp;</td>
<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>
2009-08-09 11:17:39 +02:00
</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="8188cb5c264e6021cee9979b968a0305"></a><!-- doxytag: member="neuralpp::Layer::elements" ref="8188cb5c264e6021cee9979b968a0305" args="" -->
2009-08-09 11:17:39 +02:00
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::vector&lt;<a class="el" href="classneuralpp_1_1Neuron.html">Neuron</a>&gt; <a class="el" href="classneuralpp_1_1Layer.html#8188cb5c264e6021cee9979b968a0305">neuralpp::Layer::elements</a><code> [private]</code> </td>
2009-08-09 11:17:39 +02:00
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="02cf4efe1da02a7404d25375c85ed71f"></a><!-- doxytag: member="neuralpp::Layer::threshold" ref="02cf4efe1da02a7404d25375c85ed71f" args="" -->
2009-08-09 11:17:39 +02:00
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double <a class="el" href="classneuralpp_1_1Layer.html#02cf4efe1da02a7404d25375c85ed71f">neuralpp::Layer::threshold</a><code> [private]</code> </td>
2009-08-09 11:17:39 +02:00
</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-09-04 11:27:14 +02:00
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Sep 4 11:25:49 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>