RBFNet Class Reference

Offers the functions to create and to work with radial basis function network. More...

#include <RBFNet.h>

Inheritance diagram for RBFNet:
Model MSERBFNet

List of all members.

Public Member Functions

void read (std::istream &is)
 Reads a network from the input stream "is".
void write (std::ostream &os) const
 Writes a network to the output stream "os".
 RBFNet (unsigned numInput, unsigned numOutput, unsigned numHidden)
 Creates a Radial Basis Function Network.
 RBFNet (const std::string &filename)
 Creates a Radial Basis Function Network by reading information from file "filename".
 RBFNet (unsigned numInput, unsigned numOutput, unsigned numHidden, const Array< double > &_m, const Array< double > &_A, const Array< double > &_b, const Array< double > &_v)
void initRBFNet (const Array< double > &input, const Array< double > &target)
 Initializes the Radial Basis Function Network.
void model (const Array< double > &input, Array< double > &target)
 Evaluates the RBFN-Model and calculates the output values.
void setParameter (unsigned int index, double value)
 Modifies a specific model parameter.
void modelDerivative (const Array< double > &input, Array< double > &derivative)
 Calculates the derivatives of the model with respect to the weights and stores the results in ModelInterface::dmdw.
void modelDerivative (const Array< double > &input, Array< double > &output, Array< double > &derivative)
 Calculates the derivatives of the model with respect to the weights and stores the results in ModelInterface::dmdw. Furthermode, the output of the model is evaluated.
const Array< double > & getWeights () const
 Returns the weights of the connections between hidden and output neurons.
const Array< double > & getBias () const
 Returns the bias of all output neurons.
const Array< double > & getCenter () const
 Returns the centers of all hidden neurons.
const Array< double > & getVariance () const
 Returns the variances of all hidden neurons.
const unsigned getNHidden () const
 Returns the number of hidden neurons.
void setWeights (const Array< double > &_A)
 Sets the weights of connections between hidden and output neurons.
void setBias (const Array< double > &_b)
 Sets the bias of the output neurons.
void setCenter (const Array< double > &_m)
 Sets the centers of the hidden neurons.
void setVariance (const Array< double > &_v)
 Sets the variances of the hidden neurons.

Detailed Description

Offers the functions to create and to work with radial basis function network.

Together with an error measure and an optimization algorithm class you can use this radial basis function network class to produce your own optimization tool. Radial Basis Function networks are especially used for classification tasks. For this purpose the class of models contains, besides the number of hidden neurons $nHidden$, 4 different kinds of parameters: the centers of the hidden neurons $\vec{m}_j=(m_{j1},\ldots,m_{jn})$, the standard deviations of the hidden neurons $\vec{\sigma}_j=(\sigma_{j1},\ldots,\sigma_{jn})$, the weights of the connections between the hidden neuron with index $j$ and output neuron with index $k$ and the bias $b_k$ of the output neuron with index $k$. The output neuron with index $k$ yields the following output, assuming a $nInput$-dimensional input vector $\vec{x}$:

\[ y_k = b_k + \sum_{j=1}^{nHidden} \exp\left[ -\frac{1}{2}\sum_{i=1}^{nInput} \frac{\left(x_i-m_{ji}\right)2}{\sigma_{ji}}\right] \]

Author:
C. Igel
Date:
1999
Changes:
none
Status:
stable

Definition at line 96 of file RBFNet.h.


Constructor & Destructor Documentation

RBFNet::RBFNet ( unsigned  numInput,
unsigned  numOutput,
unsigned  numHidden 
) [inline]

Creates a Radial Basis Function Network.

Constructor 1

This method creates a Radial Basis Function Network (RBFN) with numInput input neurons, numOutput output neurons and numHidden hidden neurons.

Parameters:
numInput Number of input neurons, equal to dimensionality of input space.
numOutput Number of output neurons, equal to dimensionality of output space.
numHidden Number of hidden neurons.
Returns:
None.
Author:
C. Igel
Date:
1999
Changes
none
Status
none

Definition at line 130 of file RBFNet.h.

References Model::inputDimension, Model::outputDimension, and Model::parameter.

RBFNet::RBFNet ( const std::string &  filename  )  [inline]

Creates a Radial Basis Function Network by reading information from file "filename".

Constructor 2

This method creates a Radial Basis Function Network (RBFN) which is definded in the file filename.

Parameters:
filename Name of the file the RBFN definition is read from.
Returns:
None.
Author:
L. Arnold
Date:
2002
Changes
none
Status
stable

Definition at line 165 of file RBFNet.h.

RBFNet::RBFNet ( unsigned  numInput,
unsigned  numOutput,
unsigned  numHidden,
const Array< double > &  _m,
const Array< double > &  _A,
const Array< double > &  _b,
const Array< double > &  _v 
) [inline]

Constructor 3

This method creates a Radial Basis Function Network (RBFN) with numInput input neurons, numOutput output neurons and numHidden hidden neurons and initializes the parameters.

Parameters:
numInput Number of input neurons, equal to dimensionality of input space.
numOutput Number of output neurons, equal to dimensionality of output space.
numHidden Number of hidden neurons.
_m centers
_A output weights
_b biases
_v variances
Returns:
None.
Author:
C. Igel
Date:
2003
Changes
none
Status
stable

Definition at line 215 of file RBFNet.h.

References Model::inputDimension, Model::outputDimension, and Model::parameter.


Member Function Documentation

const Array<double>& RBFNet::getBias (  )  const [inline]

Returns the bias of all output neurons.

The bias values are contained in an 1-dimensional array. The element $b_{k}$ is the bias of the $k^{th}$ output neuron.

Returns:
The bias values of the output neurons.
Author:
M. Hüsken
Date:
2001
Changes
none
Status
stable

Definition at line 404 of file RBFNet.h.

Referenced by write().

const Array<double>& RBFNet::getCenter (  )  const [inline]

Returns the centers of all hidden neurons.

The center values are contained in an 2-dimensional array. The element $m_{ji}$ is the $i^{th}$ coordinate of the center of the $j^{th}$ hidden neuron.

Returns:
The center values of the hidden neurons.
Author:
M. Hüsken
Date:
2001
Changes
none
Status
stable

Definition at line 430 of file RBFNet.h.

Referenced by write().

const unsigned RBFNet::getNHidden (  )  const [inline]

Returns the number of hidden neurons.

Returns:
The number of hidden neurons.
Author:
M. Hüsken
Date:
2001
Changes
none
Status
stable

Definition at line 478 of file RBFNet.h.

Referenced by write().

const Array<double>& RBFNet::getVariance (  )  const [inline]

Returns the variances of all hidden neurons.

The variances are contained in an 2-dimensional array. The element $\sigma_{ji}$ is the $i^{th}$ coordinate of the variance of the $j^{th}$ hidden neuron.

Returns:
The variances of the hidden neurons.
Author:
M. Hüsken
Date:
2001
Changes
none
Status
stable

Definition at line 456 of file RBFNet.h.

Referenced by write().

const Array<double>& RBFNet::getWeights (  )  const [inline]

Returns the weights of the connections between hidden and output neurons.

Returns an array containing the weights of the connections between hidden and output neurons. The array is a two-dimensional object, the element $w_{ji}$ is the weight of the connection from the $i^{th}$ hidden neuron to the $j^{th}$ output neuron.

Returns:
The weight matrix.
Author:
M. Hüsken
Date:
2001
Changes
none
Status
stable

Definition at line 378 of file RBFNet.h.

Referenced by write().

void RBFNet::initRBFNet ( const Array< double > &  input,
const Array< double > &  target 
) [inline]

Initializes the Radial Basis Function Network.

This method initializes the parameters of the RBFN-model. First, it performs a K-means-Clustering to determine the centers and variances of the hidden neurons. Thereafter, the connection weights and bias values are determined by means of a linear regression.

Parameters:
input Vector of input values.
target Vector of target values.
Returns:
None.
Author:
C. Igel
Date:
1999
Changes
none
Status
none

Definition at line 260 of file RBFNet.h.

References Model::parameter.

void RBFNet::model ( const Array< double > &  input,
Array< double > &  target 
) [inline, virtual]

Evaluates the RBFN-Model and calculates the output values.

This method evaluates the RBFN and determines the output values based on the following formula:

\[ y_k = b_k + \sum_{j=1}^{nHidden} \exp\left[ -\frac{1}{2}\sum_{i=1}^{nInput} \frac{\left(x_i-m_{ji}\right)2}{\sigma_{ji}}\right] \]

Parameters:
input Vector of input values.
target Vector of target values.
Returns:
None.
Author:
C. Igel
Date:
1999
Changes
none
Status
none

Implements Model.

Definition at line 292 of file RBFNet.h.

References Model::parameter.

void RBFNet::modelDerivative ( const Array< double > &  input,
Array< double > &  output,
Array< double > &  derivative 
) [inline, virtual]

Calculates the derivatives of the model with respect to the weights and stores the results in ModelInterface::dmdw. Furthermode, the output of the model is evaluated.

Parameters:
input Vector of input values.
output Vector of evaluated output values.
Returns:
None.
Author:
C. Igel
Date:
1999
Changes
none
Status
none

Reimplemented from Model.

Definition at line 349 of file RBFNet.h.

References Model::parameter.

void RBFNet::modelDerivative ( const Array< double > &  input,
Array< double > &  derivative 
) [inline, virtual]

Calculates the derivatives of the model with respect to the weights and stores the results in ModelInterface::dmdw.

Parameters:
input Vector of input values.
Returns:
None.
Author:
C. Igel
Date:
1999
Changes
none
Status
none

Reimplemented from Model.

Definition at line 323 of file RBFNet.h.

References Model::parameter.

void RBFNet::read ( std::istream &  is  )  [virtual]

Reads a network from the input stream "is".

The number of input, output and hidden neurons, and also the center, variance, weight and bias matrices are read from the input stream is, memory for the internal net data structures is reserved and the weight and bias values are written to the parameter vector Model::parameter.

Parameters:
is The input stream.
Returns:
Reference to the input stream.
Author:
L. Arnold
Date:
2002
Changes
none
Status
stable

Reimplemented from Model.

Definition at line 668 of file RBFNet.h.

References i, Model::inputDimension, Model::outputDimension, Model::parameter, setBias(), setCenter(), setVariance(), and setWeights().

void RBFNet::setBias ( const Array< double > &  _b  )  [inline]

Sets the bias of the output neurons.

This method sets the bias of the output neurons. The bias is described by means of an one-dimensional array, the element $b_{k}$ is the bias of the $k^{th}$ output neuron.

Parameters:
_b The new bias values.
Returns:
None.
Author:
M. Hüsken
Date:
2001
Changes
none
Status
stable

Definition at line 535 of file RBFNet.h.

References Model::parameter.

Referenced by read().

void RBFNet::setCenter ( const Array< double > &  _m  )  [inline]

Sets the centers of the hidden neurons.

This method sets the centers of the hidden neurons. The centers are described by means of a two-dimensional array, the element $m_{ji}$ is the $i^{th}$ coordinate of the center of the $j^{th}$ hidden neuron.

Parameters:
_m The new center values.
Returns:
None.
Author:
M. Hüsken
Date:
2001
Changes
none
Status
stable

Definition at line 564 of file RBFNet.h.

References Model::parameter.

Referenced by read().

void RBFNet::setParameter ( unsigned int  index,
double  value 
) [inline, virtual]

Modifies a specific model parameter.

Reimplemented from Model.

Definition at line 299 of file RBFNet.h.

References Model::parameter.

void RBFNet::setVariance ( const Array< double > &  _v  )  [inline]

Sets the variances of the hidden neurons.

This method sets the variances of the hidden neurons. The variances are described by means of a two-dimensional array, the element $\sigma_{ji}$ is the $i^{th}$ coordinate of the variance of the $j^{th}$ hidden neuron.

Parameters:
_v The new variance values.
Returns:
None.
Author:
M. Hüsken
Date:
2001
Changes
none
Status
stable

Definition at line 593 of file RBFNet.h.

References Model::parameter.

Referenced by read().

void RBFNet::setWeights ( const Array< double > &  _A  )  [inline]

Sets the weights of connections between hidden and output neurons.

Sets the weights of the connections between hidden and output neurons. The weights are described by means of a two-dimensional array, the element $w_{ji}$ is the weight of the connection from the $i^{th}$ hidden neuron to the $j^{th}$ output neuron.

Parameters:
_A The new weight values.
Returns:
None.
Author:
M. Hüsken
Date:
2001
Changes
none
Status
stable

Definition at line 507 of file RBFNet.h.

References Model::parameter.

Referenced by read().

void RBFNet::write ( std::ostream &  os  )  const [virtual]

Writes a network to the output stream "os".

The number of input, output and hidden neurons and also the center, variance, weights and bias matrices are written to the output stream os.

Parameters:
os The output stream.
net The net that will be written to the output stream.
Returns:
Reference to the output stream.
Author:
L. Arnold
Date:
2002
Changes
none
Status
stable

Reimplemented from Model.

Definition at line 628 of file RBFNet.h.

References getBias(), getCenter(), getNHidden(), getVariance(), and getWeights().


The documentation for this class was generated from the following file: