mirror of
https://github.com/BlackLight/neuralpp.git
synced 2024-12-29 12:45:12 +01:00
381 lines
17 KiB
HTML
381 lines
17 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>
|
|
</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#411a4dc8a1bb2fe44fe7a69fa50fd764">Layer</a> (size_t sz, double(*a)(double), double(*d)(double))</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#411a4dc8a1bb2fe44fe7a69fa50fd764"></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#117d1c3b481641816e80ea36826d2107">Layer</a> (vector< <a class="el" href="classneuralpp_1_1Neuron.html">Neuron</a> > &neurons, double(*a)(double), double(*d)(double))</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Alternative constructor. <a href="#117d1c3b481641816e80ea36826d2107"></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)</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#dbad95f635343a2998794113d7762cf7">setProp</a> (vector< double > &v)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1Layer.html#98f79281b680b1d18fd91fa5794c0899">setActv</a> (vector< double > &v)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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 </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#c8d2f7513e5d40518f9dddfd1e3ddcc5">size</a> ()</td></tr>
|
|
|
|
<tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">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#855685c9da56b06b629e13a2f8c719ce">elements</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>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">double(* </td><td class="memItemRight" valign="bottom"><a class="el" href="classneuralpp_1_1Layer.html#a0207b14ba80aaf03502749ecb7d23fa">deriv</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="411a4dc8a1bb2fe44fe7a69fa50fd764"></a><!-- doxytag: member="neuralpp::Layer::Layer" ref="411a4dc8a1bb2fe44fe7a69fa50fd764" args="(size_t sz, double(*a)(double), double(*d)(double))" -->
|
|
<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(*)(double) </td>
|
|
<td class="paramname"> <em>d</em></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>d</em> </td><td>Its derivate </td></tr>
|
|
</table>
|
|
</dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="117d1c3b481641816e80ea36826d2107"></a><!-- doxytag: member="neuralpp::Layer::Layer" ref="117d1c3b481641816e80ea36826d2107" args="(vector< Neuron > &neurons, double(*a)(double), double(*d)(double))" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">neuralpp::Layer::Layer </td>
|
|
<td>(</td>
|
|
<td class="paramtype">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(*)(double) </td>
|
|
<td class="paramname"> <em>d</em></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>d</em> </td><td>Its derivate </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></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="dbad95f635343a2998794113d7762cf7"></a><!-- doxytag: member="neuralpp::Layer::setProp" ref="dbad95f635343a2998794113d7762cf7" args="(vector< double > &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< double > & </td>
|
|
<td class="paramname"> <em>v</em> </td>
|
|
<td> ) </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> </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< double > &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< double > & </td>
|
|
<td class="paramname"> <em>v</em> </td>
|
|
<td> ) </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> </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> ) </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="c8d2f7513e5d40518f9dddfd1e3ddcc5"></a><!-- doxytag: member="neuralpp::Layer::size" ref="c8d2f7513e5d40518f9dddfd1e3ddcc5" args="()" -->
|
|
<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></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="855685c9da56b06b629e13a2f8c719ce"></a><!-- doxytag: member="neuralpp::Layer::elements" ref="855685c9da56b06b629e13a2f8c719ce" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">vector<<a class="el" href="classneuralpp_1_1Neuron.html">Neuron</a>> <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>
|
|
<a class="anchor" name="a0207b14ba80aaf03502749ecb7d23fa"></a><!-- doxytag: member="neuralpp::Layer::deriv" ref="a0207b14ba80aaf03502749ecb7d23fa" args=")(double)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double(* <a class="el" href="classneuralpp_1_1Layer.html#a0207b14ba80aaf03502749ecb7d23fa">neuralpp::Layer::deriv</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 9 11:11:18 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>
|