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

Network Class Reference

Another core class of the annie library, a generic template for a neural network. More...

#include <Network.h>

Inheritance diagram for Network:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Network (int inputs, int outputs)
 Default constructor.

 Network (Network &)
 Copy constructor.

virtual ~Network ()
virtual Vector getOutput (const Vector &input)=0
 The output of the network given a stimulus.

virtual Vector getOutput (real *input)
 Wrapper function, calls getOutput(Vector &input).

virtual void setMetaData (const char *metaData)
 Sets the meta data of the network Meta data is arbitrary text that you may want to tag the network with.

virtual void setMetaData (std::string metaData)
 Sets the meta data of the network Meta data is arbitrary text that you may want to tag the network with.

virtual std::string getMetaData ()
 Returns the meta data string.

virtual uint getInputCount () const
 Number of inputs taken in by the network.

virtual uint getOutputCount () const
 Number of outputs given by the network.

virtual const char * getClassName () const=0
 For reflection.

virtual void save (const std::string &filename)=0
 Save the network structure to the given text file.


Static Public Member Functions

std::string getNetworkClassName (const char *filename)
 Finds the name of the network class from the given file.


Protected Attributes

uint _nInputs
 Number of inputs taken in by the network.

uint _nOutputs
 Number of outputs given by the network.

std::string _metaData
 A string of meta data, can be used by users as pleased.


Detailed Description

Another core class of the annie library, a generic template for a neural network.

This class is not instantiable itself. Different types of networks must be derived from this class.

The common information held by each network is the number of inputs (i.e., values that are obtained from the environment), the number of outputs (i.e., values that are given to the environment) and a string of meta data than can be used by users as pleased.

Todo:
The copy constructor


Constructor & Destructor Documentation

Network int  inputs,
int  outputs
 

Default constructor.

Parameters:
inputs Number of inputs taken in by the network
outputs Number of outputs given out by the network

Network Network  ) 
 

Copy constructor.

NOT YET IMPLEMENTED

virtual ~Network  )  [virtual]
 


Member Function Documentation

virtual const char* getClassName  )  const [pure virtual]
 

For reflection.

All sub-classes MUST implement this method, which should just return class name

Implemented in HopfieldBase, KohonenNetwork, MultiLayerNetwork, RadialBasisNetwork, and RecurrentNetwork.

virtual uint getInputCount  )  const [virtual]
 

Number of inputs taken in by the network.

Reimplemented in RecurrentNetwork.

virtual std::string getMetaData  )  [virtual]
 

Returns the meta data string.

std::string getNetworkClassName const char *  filename  )  [static]
 

Finds the name of the network class from the given file.

virtual Vector getOutput real input  )  [virtual]
 

Wrapper function, calls getOutput(Vector &input).

Reimplemented in MultiLayerNetwork, and RadialBasisNetwork.

virtual Vector getOutput const Vector input  )  [pure virtual]
 

The output of the network given a stimulus.

Note that instantiable sub-classes of Network must define this function. How the network determines the output given the input is what characterizes it.

Parameters:
input The input given to the network, a Vector of size getInputCount()
Returns:
The corresponding output vector (size = getOutputCount())

Implemented in HopfieldBase, KohonenNetwork, MultiLayerNetwork, and RecurrentNetwork.

virtual uint getOutputCount  )  const [virtual]
 

Number of outputs given by the network.

Reimplemented in RecurrentNetwork.

virtual void save const std::string &  filename  )  [pure virtual]
 

Save the network structure to the given text file.

The file format is quite simple and is commented.

Parameters:
filename Name of the file to save network information into

Implemented in HopfieldBase, HopfieldNetwork, KohonenNetwork, MultiLayerNetwork, and RecurrentNetwork.

virtual void setMetaData std::string  metaData  )  [virtual]
 

Sets the meta data of the network Meta data is arbitrary text that you may want to tag the network with.

This has no effect on the network output etc

virtual void setMetaData const char *  metaData  )  [virtual]
 

Sets the meta data of the network Meta data is arbitrary text that you may want to tag the network with.

This has no effect on the network output etc


Member Data Documentation

std::string _metaData [protected]
 

A string of meta data, can be used by users as pleased.

uint _nInputs [protected]
 

Number of inputs taken in by the network.

There should be these many InputNeurons in the network

uint _nOutputs [protected]
 

Number of outputs given by the network.


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