Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Layer Class Reference

Abstraction for a "layer" of neurons, i.e., a group of neurons not connected to each other. More...

#include <Layer.h>

Inheritance diagram for Layer:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Layer (int label)
 Constructs a layer with the given label.

virtual ~Layer ()
 deletes all neurons

virtual int getLabel () const
 Returns the label of the layer.

virtual uint getSize () const
 The size of the layer (number of neurons in it).

uint size () const
 complies w/ STL ..

virtual void addNeuron (Neuron *nrn)
 Adds the given neuron to the layer Layer is responsible for deletion.

virtual NeurongetNeuron (uint i)
 Gives the ith reference in the layer.

virtual const NeurongetNeuron (uint i) const
Neuronoperator[] (uint i)
const Neuronoperator[] (uint i) const
virtual Vector getActivation ()
 The activation vector formed by the activations of individual neurons in the layer.

virtual Vector getOutput ()
 The output vector formed by the outputs of individual neurons in the layer.

virtual const char * getClassName ()
 Returns "Layer".


Static Public Attributes

const int MAX_LAYER_SIZE
 The maximum number of neurons in a layer Needed for some automatic label assignments of neurons and layers in Networks.


Protected Attributes

int _label
 The label of the layer.

uint _size
 The number of neurons in the layer.

std::vector< Neuron * > _neurons
 The neurons in this layer.


Detailed Description

Abstraction for a "layer" of neurons, i.e., a group of neurons not connected to each other.

See also:
InputLayer


Constructor & Destructor Documentation

Layer int  label  ) 
 

Constructs a layer with the given label.

virtual ~Layer  )  [virtual]
 

deletes all neurons


Member Function Documentation

virtual void addNeuron Neuron nrn  )  [virtual]
 

Adds the given neuron to the layer Layer is responsible for deletion.

Reimplemented in InputLayer.

virtual Vector getActivation  )  [virtual]
 

The activation vector formed by the activations of individual neurons in the layer.

virtual const char* getClassName  )  [virtual]
 

Returns "Layer".

Reimplemented in InputLayer.

virtual int getLabel  )  const [virtual]
 

Returns the label of the layer.

virtual const Neuron& getNeuron uint  i  )  const [virtual]
 

virtual Neuron& getNeuron uint  i  )  [virtual]
 

Gives the ith reference in the layer.

Parameters:
i The index of the neuron in the layer (0<=i<getSize()).
Exceptions:
Exception if the index given is invalid

virtual Vector getOutput  )  [virtual]
 

The output vector formed by the outputs of individual neurons in the layer.

virtual uint getSize  )  const [virtual]
 

The size of the layer (number of neurons in it).

const Neuron& operator[] uint  i  )  const [inline]
 

Reimplemented in TLayer, TLayer< RecurrentNeuron >, and TLayer< InputNeuron >.

Here is the call graph for this function:

Neuron& operator[] uint  i  )  [inline]
 

Reimplemented in TLayer, TLayer< RecurrentNeuron >, and TLayer< InputNeuron >.

Here is the call graph for this function:

uint size  )  const [inline]
 

complies w/ STL ..

Here is the call graph for this function:


Member Data Documentation

int _label [protected]
 

The label of the layer.

std::vector<Neuron *> _neurons [protected]
 

The neurons in this layer.

uint _size [protected]
 

The number of neurons in the layer.

If you create a sub-class of this class, then the onus of ensuring that this value is consistent lies on you!

const int MAX_LAYER_SIZE [static]
 

The maximum number of neurons in a layer Needed for some automatic label assignments of neurons and layers in Networks.


The documentation for this class was generated from the following file:
Generated on Fri Jun 18 13:19:08 2004 for Annie by doxygen 1.3.5