neuralpp::Layer Class Reference

Class for managing layers of neurons. More...

#include <neural++.hpp>

List of all members.

Public Member Functions

 Layer (size_t sz, double(*a)(double))
 Constructor.
 Layer (vector< Neuron > &neurons, double(*a)(double))
 Alternative constructor.
Neuronoperator[] (size_t i) throw (NetworkIndexOutOfBoundsException)
 Redefinition for operator [].
void link (Layer &l)
 It links a layer to another.
void setProp (vector< double > &v)
 It sets a vector of propagation values to all its neurons.
void setActv (vector< double > &v)
 It sets a vector of activation values to all its neurons.
void propagate ()
 It propagates its activation values to the output layers.
size_t size () const

Private Attributes

vector< Neuronelements
void(* update_weights )()
double(* actv_f )(double)


Detailed Description

Class for managing layers of neurons.

Don't use this class directly unless you know what you're doing, use NeuralNet instead


Constructor & Destructor Documentation

neuralpp::Layer::Layer ( size_t  sz,
double(*)(double)  a 
)

Constructor.

Parameters:
sz Size of the layer
a Activation function

neuralpp::Layer::Layer ( vector< Neuron > &  neurons,
double(*)(double)  a 
)

Alternative constructor.

It directly gets a vector of neurons to build the layer

Parameters:
neurons Vector of neurons to be included in the layer
a Activation function


Member Function Documentation

Neuron& neuralpp::Layer::operator[] ( size_t  i  )  throw (NetworkIndexOutOfBoundsException)

Redefinition for operator [].

It gets the neuron at i

Parameters:
i Index of the neuron to get in the layer
Returns:
Reference to the i-th neuron

void neuralpp::Layer::link ( Layer l  ) 

It links a layer to another.

Parameters:
l Layer to connect to the current as input layer

void neuralpp::Layer::setProp ( vector< double > &  v  ) 

It sets a vector of propagation values to all its neurons.

Parameters:
v Vector of values to write as propagation values

void neuralpp::Layer::setActv ( vector< double > &  v  ) 

It sets a vector of activation values to all its neurons.

Parameters:
v Vector of values to write as activation values

void neuralpp::Layer::propagate (  ) 

It propagates its activation values to the output layers.

size_t neuralpp::Layer::size (  )  const

Returns:
Number of neurons in the layer


Member Data Documentation

vector<Neuron> neuralpp::Layer::elements [private]

void(* neuralpp::Layer::update_weights)() [private]

double(* neuralpp::Layer::actv_f)(double) [private]


The documentation for this class was generated from the following file:

Generated on Sat Aug 15 02:56:02 2009 for Neural++ by  doxygen 1.5.6