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

annie::RadialBasisNetwork Class Reference

#include <RadialBasisNetwork.h>

Inheritance diagram for annie::RadialBasisNetwork:

annie::Network List of all members.

Public Methods

 RadialBasisNetwork (int inputs, int centers, int outputs)
 RadialBasisNetwork (const char *filename)
 RadialBasisNetwork (RadialBasisNetwork &srcNet)
 Copy constructor, NOT YET IMPLEMENTED. More...

virtual ~RadialBasisNetwork ()
virtual void setCenter (int i, VECTOR &center)
virtual void setCenter (int i, real *center)
virtual VECTOR getCenter (int i)
virtual int getCenterCount ()
 The number of centers in the network. More...

virtual void setBias (int i, real bias)
virtual real getBias (int i)
virtual void removeBias (int i)
virtual void setWeight (int center, int output, real weight)
virtual real getWeight (int center, int output)
virtual VECTOR getOutput (VECTOR &input)
virtual VECTOR getOutput (real *input)
void setCenterActivationFunction (ActivationFunction f, ActivationFunction df)
void trainWeights (TrainingSet &T)
virtual const char * getClassName ()
 Returns "RadialBasisNetwork". More...

virtual void save (const char *filename)
 Save the network to a text file. More...


Protected Attributes

int _nCenters
InputLayer_inputLayer
 Layer of input. Each member is an InputNeuron. More...

Layer_centerLayer
 Layer of centers, each member is a CenterNEuron. More...

Layer_outputLayer
 Layer of output, each member if a SimpleNeuron. More...


Detailed Description

A Radial Basis Function Neural Network.

The network consists of a layer of N-inputs, then h-(N-dimensional) centers, and some outputs. The default activation function for the centers is gaussian(), which is the gaussian distribution function with sigma = 1. If you want to change that then you'll have to write your own activation function and change it with setCenterActivationFunction(). The output neurons use the identity() function as the activation function, thus the output is simply the weighted sum of the outputs of the centers.

There are atleast two ways to train a radial basis network.

One involves fixed centers and training the weights only in order to minimize the error over a training set. The other involves using the gradient descent rule to adjust both centers and weights. Currently only the former is implemented in annie using trainWeights().

See also:
trainWeights
Todo:
Implement gradient-descent rule based updation of centers and weights

The copy constructor


Constructor & Destructor Documentation

annie::RadialBasisNetwork::RadialBasisNetwork int    inputs,
int    centers,
int    outputs
 

Creates a Radial basis function network. All the outputs will have a bias.

Parameters:
inputs  Number of inputs taken in by the network
centers  Number of centers the network has. Each center will be an inputs-dimensional point
outputs  The number of outputs given by the neuron. All of them will have a bias

annie::RadialBasisNetwork::RadialBasisNetwork const char *    filename
 

Loads a network from a text file

See also:
save
Parameters:
filename  Name of the file from which to load network structure
Exceptions:
Exception  On any error

annie::RadialBasisNetwork::RadialBasisNetwork RadialBasisNetwork &    srcNet
 

Copy constructor, NOT YET IMPLEMENTED.

virtual annie::RadialBasisNetwork::~RadialBasisNetwork   [virtual]
 


Member Function Documentation

virtual real annie::RadialBasisNetwork::getBias int    i [virtual]
 

Returns the bias of the ith output

Parameters:
i  The index of the output (0<=i<getOutputCount()).
Returns:
The bias of the output. If there is no bias, it returns 0.0

virtual VECTOR annie::RadialBasisNetwork::getCenter int    i [virtual]
 

Returns the point corresponding to the ith center.

Parameters:
i  The center whose point is wanted
Returns:
The getInputCount() dimensional point corresponding to the ith center

virtual int annie::RadialBasisNetwork::getCenterCount   [virtual]
 

The number of centers in the network.

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

Returns "RadialBasisNetwork".

Implements annie::Network.

virtual VECTOR annie::RadialBasisNetwork::getOutput real   input [virtual]
 

Wrapper function to allow getOutput() to work for an array of real as input as well. Does exactly the same thing as Network::getOutput(real*).

Reimplemented from annie::Network.

virtual VECTOR annie::RadialBasisNetwork::getOutput VECTOR   input [virtual]
 

Returns the output of the network for the given input.

Parameters:
input  A vector of getDimension() reals
Returns:
The corresponding output of the network

Implements annie::Network.

virtual real annie::RadialBasisNetwork::getWeight int    center,
int    output
[virtual]
 

Returns the weight of the link between the given center and output

Parameters:
center  Index of the center (0<=center<getCenterCount()).
output  Index of the output (0<=output<getOutputCount()).
Exceptions:
Exception  if any of the parameters given is invalid

virtual void annie::RadialBasisNetwork::removeBias int    i [virtual]
 

Prevents the ith output from having any bias.

Parameters:
i  The index of the output (0<=i<getOutputCount()).
Exceptions:
Exception  if the index given is invalid

virtual void annie::RadialBasisNetwork::save const char *    filename [virtual]
 

Save the network to a text file.

Implements annie::Network.

virtual void annie::RadialBasisNetwork::setBias int    i,
real    bias
[virtual]
 

Sets the bias of the ith output.

Parameters:
i  The index of the output (0<=i<getOutputCount()).
bias  The bias to be given to that output.
Exceptions:
Exception  if that neuron isn't allowed to be biased.

virtual void annie::RadialBasisNetwork::setCenter int    i,
real   center
[virtual]
 

Sets the ith center point to the given point.

Parameters:
i  The center that is to be changed
center  The getInputCount() dimensional point

virtual void annie::RadialBasisNetwork::setCenter int    i,
VECTOR   center
[virtual]
 

Sets the ith center point to the given point.

Parameters:
i  The center that is to be changed
center  The getInputCount() dimensional point

void annie::RadialBasisNetwork::setCenterActivationFunction ActivationFunction    f,
ActivationFunction    df
 

Sets the activation function of the center neurons. (The activation function is gaussian by default)

Parameters:
f  The activation function to be used.
df  The derivation of the activation function, used in gradient descent training

virtual void annie::RadialBasisNetwork::setWeight int    center,
int    output,
real    weight
[virtual]
 

Sets the weight between the given center and output

Parameters:
center  Index of the center (0<=center<getCenterCount()).
output  Index of the output (0<=output<getOutputCount()).
weight  The weight to give to the link between the center and output.
Exceptions:
Exception  if any of the parameters given is invalid

void annie::RadialBasisNetwork::trainWeights TrainingSet   T
 

Trains the weights of the network, centers are kept fixed.

Parameters:
T  The TrainingSet from which input/desired-output pairs will be obtained


Member Data Documentation

Layer* annie::RadialBasisNetwork::_centerLayer [protected]
 

Layer of centers, each member is a CenterNEuron.

InputLayer* annie::RadialBasisNetwork::_inputLayer [protected]
 

Layer of input. Each member is an InputNeuron.

int annie::RadialBasisNetwork::_nCenters [protected]
 

Number of centers in the network. If you plan to extend this class, then the onus of keeping this value consistent lies on you

Layer* annie::RadialBasisNetwork::_outputLayer [protected]
 

Layer of output, each member if a SimpleNeuron.


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