#include <RadialBasisNetwork.h>
Inheritance diagram for RadialBasisNetwork:
Public Member Functions | |
RadialBasisNetwork (int inputs, int centers, int outputs) | |
Creates a Radial basis function network. | |
RadialBasisNetwork (const char *filename) | |
Loads a network from a text file. | |
RadialBasisNetwork (RadialBasisNetwork &srcNet) | |
Copy constructor, NOT YET IMPLEMENTED. | |
virtual | ~RadialBasisNetwork () |
virtual void | setCenter (uint i, Vector ¢er) |
Sets the ith center point to the given point. | |
virtual void | setCenter (uint i, real *center) |
Sets the ith center point to the given point. | |
virtual Vector | getCenter (int i) const |
Returns the point corresponding to the ith center. | |
virtual uint | getCenterCount () const |
The number of centers in the network. | |
virtual void | setBias (uint i, real bias) |
Sets the bias of the ith output. | |
virtual real | getBias (uint i) const |
Returns the bias of the ith output. | |
virtual void | removeBias (uint i) |
Prevents the ith output from having any bias. | |
virtual void | setWeight (int center, int output, real weight) |
Sets the weight between the given center and output. | |
virtual real | getWeight (int center, int output) const |
Returns the weight of the link between the given center and output. | |
virtual Vector | getOutput (Vector &input) |
Returns the output of the network for the given input. | |
virtual Vector | getOutput (real *input) |
Wrapper function to allow getOutput() to work for an array of real as input as well. | |
void | setCenterActivationFunction (ActivationFunction f, ActivationFunction df) |
Sets the activation function of the center neurons. | |
void | trainWeights (TrainingSet &T) |
Trains the weights of the network, centers are kept fixed. | |
virtual const char * | getClassName () const |
Returns "RadialBasisNetwork". | |
virtual void | save (const char *filename) |
Save the network to a text file. | |
Protected Attributes | |
int | _nCenters |
Number of centers in the network. | |
InputLayer * | _inputLayer |
Layer of input. Each member is an InputNeuron. | |
Layer * | _centerLayer |
Layer of centers, each member is a CenterNEuron. | |
Layer * | _outputLayer |
Layer of output, each member if a SimpleNeuron. |
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().
The copy constructor
|
Creates a Radial basis function network. All the outputs will have a bias.
|
|
Loads a network from a text file.
|
|
Copy constructor, NOT YET IMPLEMENTED.
|
|
|
|
Returns the bias of the ith output.
|
|
Returns the point corresponding to the ith center.
|
|
The number of centers in the network.
|
|
Returns "RadialBasisNetwork".
Implements Network. |
|
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 Network. |
|
Returns the output of the network for the given input.
|
|
Returns the weight of the link between the given center and output.
|
|
Prevents the ith output from having any bias.
|
|
Save the network to a text file.
|
|
Sets the bias of the ith output.
|
|
Sets the ith center point to the given point.
|
|
Sets the ith center point to the given point.
|
|
Sets the activation function of the center neurons. (The activation function is gaussian by default)
|
|
Sets the weight between the given center and output.
|
|
Trains the weights of the network, centers are kept fixed.
|
|
Layer of centers, each member is a CenterNEuron.
|
|
Layer of input. Each member is an InputNeuron.
|
|
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 of output, each member if a SimpleNeuron.
|