Offers the functions to create and to work with radial basis function networks and to train it with the mean squared error. This combination provides more computational efficiency compared to using the class MeanSquaredError. More...
#include <MSERBFNet.h>
Public Member Functions | |
| MSERBFNet (unsigned numInput, unsigned numOutput, unsigned numHidden) | |
| Creates a new Radial Basis Function Network (RBFN) with mean squared error measuring. | |
| MSERBFNet (const std::string &filename) | |
| Creates a Radial Basis Function Network by reading information from file "filename". | |
| MSERBFNet (unsigned numInput, unsigned numOutput, unsigned numHidden, const Array< double > &_m, const Array< double > &_A, const Array< double > &_b, const Array< double > &_v) | |
| double | error (Model &model, const Array< double > &input, const Array< double > &target) |
| Returns the mean squared error of the Radial Basis Function Network. | |
| double | errorDerivative (Model &model, const Array< double > &input, const Array< double > &target, Array< double > &derivative) |
Calculates the derivative of the error with respect to the parameters of the network. Additionally, the error itself is returned. | |
Offers the functions to create and to work with radial basis function networks and to train it with the mean squared error. This combination provides more computational efficiency compared to using the class MeanSquaredError.
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
, 4 different kinds of parameters: the centers of the hidden neurons
, the standard deviations of the hidden neurons
, the weights of the connections between the hidden neuron with index
and output neuron with index
and the bias
of the output neuron with index
. The output neuron with index
yields the following output, assuming a
-dimensional input vector
:
The mean squared error is used as the error measure.
Here,
denotes the number of different patterns,
and
the output and target value belonging to the
input pattern and
the number of output neurons.
Please follow the link to view the source code of this example, that shows you, how you can construct your own radial basis function neural network, completely with one error measure for training and another for monitoring and an optimization algorithm. The example itself can be executed in the example directory of package ReClaM.
Definition at line 114 of file MSERBFNet.h.
| MSERBFNet::MSERBFNet | ( | unsigned | numInput, | |
| unsigned | numOutput, | |||
| unsigned | numHidden | |||
| ) | [inline] |
Creates a new Radial Basis Function Network (RBFN) with mean squared error measuring.
This method creates a Radial Basis Function Network with numInput input neurons, numOutput output neurons and numHidden hidden neurons.
| 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. |
Definition at line 146 of file MSERBFNet.h.
| MSERBFNet::MSERBFNet | ( | 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.
| filename | Name of the file the RBFN definition is read from. |
Definition at line 176 of file MSERBFNet.h.
| MSERBFNet::MSERBFNet | ( | 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.
| 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 |
Definition at line 217 of file MSERBFNet.h.
| double MSERBFNet::error | ( | Model & | model, | |
| const Array< double > & | input, | |||
| const Array< double > & | target | |||
| ) | [inline] |
Returns the mean squared error of the Radial Basis Function Network.
This method calculates the error of the RBFN. The output of the model for the input
, given as
is compared with the
values. Given a Radial Basis Function network with
output neurons and
input patterns as stimulus, the error is calculated as:

| input | Vector of input patterns. | |
| target | Vector of target values. |
Definition at line 259 of file MSERBFNet.h.
References Model::getParameter(), Model::getParameterDimension(), i, and Model::outputDimension.
| double MSERBFNet::errorDerivative | ( | Model & | model, | |
| const Array< double > & | input, | |||
| const Array< double > & | target, | |||
| Array< double > & | derivative | |||
| ) | [inline] |
Calculates the derivative of the error
with respect to the parameters of the network. Additionally, the error itself is returned.
Calculates the derivates of the mean squared error
(see error) with respect to the parameters ModelInterface::w and stores the result in ModelInterface::dedw.
As a byproduct of the calculation of the derivative one gets the the mean squared error
itself very efficiently. Therefore, the method error returns this value. This additional effect can be switched of by means of the third parameter (returnError = false).
| input | Vector of input patterns. | |
| target | Vector of target values. | |
| returnError | Determines whether or not to calculate the error itself. By default the error is calculated. |
if returnError is set to "true", otherwise "-1" is returned.Definition at line 303 of file MSERBFNet.h.
References Model::getParameter(), Model::getParameterDimension(), i, and Model::outputDimension.