mirror of
https://github.com/BlackLight/neuralpp.git
synced 2024-11-16 14:57:14 +01:00
352 lines
16 KiB
HTML
352 lines
16 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::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 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_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 <<a class="el" href="neural_09_09_8hpp-source.html">neural++.hpp</a>></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"> </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>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#a235767701b5e9dcf28c5e9e0d04cb0b"></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_1Layer.html#d79f684523f8a6e086b962c8eef37623">Layer</a> (std::vector< <a class="el" href="classneuralpp_1_1Neuron.html">Neuron</a> > &neurons, double(*a)(double), double th=0.0)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Alternative constructor. <a href="#d79f684523f8a6e086b962c8eef37623"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classneuralpp_1_1Neuron.html">Neuron</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1Layer.html#45ff7554830558155c6fbce3b6827122">operator[]</a> (size_t i) throw (NetworkIndexOutOfBoundsException)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Redefinition for operator []. <a href="#45ff7554830558155c6fbce3b6827122"></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_1Layer.html#ac33444fde14633fa1ad4acb024ad150">link</a> (<a class="el" href="classneuralpp_1_1Layer.html">Layer</a> &l)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1Layer.html#88ceffc23f02a9dc24d4355767b7cca7">setInput</a> (std::vector< double > v)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1Layer.html#fcfd306039dbaf91c9e2dcc8fc1f1ce1">propagate</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">It propagates its activation values to the output layers. <a href="#fcfd306039dbaf91c9e2dcc8fc1f1ce1"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1Layer.html#7ca71ed62fbe9c1e9c0fb6a8dcaf76f0">size</a> () const </td></tr>
|
|
|
|
<tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::vector< <a class="el" href="classneuralpp_1_1Neuron.html">Neuron</a> > </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 </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1Layer.html#02cf4efe1da02a7404d25375c85ed71f">threshold</a></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void(* </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(* </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's class.">NeuralNet</a> instead <hr><h2>Constructor & 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)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">neuralpp::Layer::Layer </td>
|
|
<td>(</td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>sz</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double(*)(double) </td>
|
|
<td class="paramname"> <em>a</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><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>sz</em> </td><td>Size of the layer </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>a</em> </td><td>Activation function </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>
|
|
</table>
|
|
</dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="d79f684523f8a6e086b962c8eef37623"></a><!-- doxytag: member="neuralpp::Layer::Layer" ref="d79f684523f8a6e086b962c8eef37623" args="(std::vector< Neuron > &neurons, double(*a)(double), double th=0.0)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">neuralpp::Layer::Layer </td>
|
|
<td>(</td>
|
|
<td class="paramtype">std::vector< <a class="el" href="classneuralpp_1_1Neuron.html">Neuron</a> > & </td>
|
|
<td class="paramname"> <em>neurons</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double(*)(double) </td>
|
|
<td class="paramname"> <em>a</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><td> </td>
|
|
</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> </td><td>Vector of neurons to be included in the layer </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>a</em> </td><td>Activation function </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>
|
|
</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>& neuralpp::Layer::operator[] </td>
|
|
<td>(</td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>i</em> </td>
|
|
<td> ) </td>
|
|
<td> throw (<a class="el" href="classneuralpp_1_1NetworkIndexOutOfBoundsException.html">NetworkIndexOutOfBoundsException</a>)</td>
|
|
</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> </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 &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> & </td>
|
|
<td class="paramname"> <em>l</em> </td>
|
|
<td> ) </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> </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< double > v)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void neuralpp::Layer::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>
|
|
Set the input values for the neurons of the layer (just use it for the input 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>v</em> </td><td>Vector containing the input 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> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
It propagates its activation values to the output layers.
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="7ca71ed62fbe9c1e9c0fb6a8dcaf76f0"></a><!-- doxytag: member="neuralpp::Layer::size" ref="7ca71ed62fbe9c1e9c0fb6a8dcaf76f0" args="() const " -->
|
|
<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> ) </td>
|
|
<td> const</td>
|
|
</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="8188cb5c264e6021cee9979b968a0305"></a><!-- doxytag: member="neuralpp::Layer::elements" ref="8188cb5c264e6021cee9979b968a0305" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">std::vector<<a class="el" href="classneuralpp_1_1Neuron.html">Neuron</a>> <a class="el" href="classneuralpp_1_1Layer.html#8188cb5c264e6021cee9979b968a0305">neuralpp::Layer::elements</a><code> [private]</code> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="02cf4efe1da02a7404d25375c85ed71f"></a><!-- doxytag: member="neuralpp::Layer::threshold" ref="02cf4efe1da02a7404d25375c85ed71f" args="" -->
|
|
<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>
|
|
</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>
|
|
<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>
|