Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

annie::TwoLayerNetwork Class Reference

#include <TwoLayerNetwork.h>

Inheritance diagram for annie::TwoLayerNetwork:

annie::MultiLayerNetwork annie::Network List of all members.

Public Methods

 TwoLayerNetwork (int inputs, int hidden, int outputs)
 TwoLayerNetwork (const char *filename)
virtual void connect2in (int input, int hidden)
virtual void connect2in (int input, int hidden, real weight)
virtual void connect2out (int hidden, int output)
virtual void connect2out (int hidden, int output, real weight)
virtual void connectAll ()
virtual void addLayer (int size)
virtual const char * getClassName ()
 Returns "TwoLayerNetwork". More...


Detailed Description

Two layered networks are very commonly used. This is basically a multi-layer perceptron network with only two layers - one hidden and one output (the input is not counted as a layer). This class basically derives from a MultiLayerNetwork and adds functionality that make it easier to use if the network you're dealing with has only 2 layers. There is nothing you can do with this class that you can't do with MultiLayerNetwork, just that this may be easier to use.


Constructor & Destructor Documentation

annie::TwoLayerNetwork::TwoLayerNetwork int    inputs,
int    hidden,
int    outputs
 

Creates a two layer network

Parameters:
inputs  The number of inputs taken in by the network
hidden  The number of hidden neurons in the network
outputs  The size of the output vector (number of outputs given by the network)

annie::TwoLayerNetwork::TwoLayerNetwork const char *    filename
 

Loads a two-layer network from a file. The file is exactly the same as a MultiLayerNetwork file, and can be loaded there as well.

Exceptions:
Exception  if the file read does not correspond to a two layer network


Member Function Documentation

virtual void annie::TwoLayerNetwork::addLayer int    size [virtual]
 

Overrides MultiLayerNetwork::addLayer() so that it cannot be done.

Exceptions:
Exception  Because the number of layers of this class is fixed, so you shouldn't be allowed to add a layer

Reimplemented from annie::MultiLayerNetwork.

virtual void annie::TwoLayerNetwork::connect2in int    input,
int    hidden,
real    weight
[virtual]
 

Connects an input and a hidden neuron with the given weight

Parameters:
input  The index of the input neuron
hidden  The index of the hidden neuron in the hidden layer
weight  The weight of the connection

virtual void annie::TwoLayerNetwork::connect2in int    input,
int    hidden
[virtual]
 

Connects an input and a hidden neuron with a random weight

Parameters:
input  The index of the input neuron
hidden  The index of the hidden neuron in the hidden layer

virtual void annie::TwoLayerNetwork::connect2out int    hidden,
int    output,
real    weight
[virtual]
 

Connects a hidden and an output neuron with the given weight

Parameters:
hidden  The index of the hidden neuron in the hidden layer
output  The index of the output neuron in the output layer
weight  The weight of the connection

virtual void annie::TwoLayerNetwork::connect2out int    hidden,
int    output
[virtual]
 

Connects a hidden and an output neuron with a random weight

Parameters:
hidden  The index of the hidden neuron in the hidden layer
output  The index of the output neuron in the output layer

virtual void annie::TwoLayerNetwork::connectAll   [virtual]
 

Completely connects the network. All inputs are connected to all hidden neurons and all hidden neurons to all output neurons

virtual const char* annie::TwoLayerNetwork::getClassName   [virtual]
 

Returns "TwoLayerNetwork".

Reimplemented from annie::MultiLayerNetwork.


The documentation for this class was generated from the following file:
Generated on Wed Apr 23 10:42:36 2003 for BioFilter by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002