Inheritance diagram for BackPropagationAlgo:


Constructors | |
| BackPropagationAlgo (BaseNeuralNet *n_n, UpdatableVec update_order, Real l_r=0.1f) | |
Interface | |
| void | setTeachingInput (Cluster *output, const RealVec &ti) |
| virtual void | learn () |
| virtual void | learn (const Pattern &) |
| virtual Real | calculateMSE (const Pattern &) |
| void | setRate (Real newrate) |
| Real | rate () |
| void | setMomentum (Real newmom) |
| Real | momentum () |
| void | enableMomentum () |
| void | disableMomentum () |
| const RealVec & | getError (Cluster *) |
| BackPropagationAlgo | ( | BaseNeuralNet * | n_n, | |
| UpdatableVec | update_order, | |||
| Real | l_r = 0.1f | |||
| ) |
Constructor
| neural_network | the BaseNeuralNet neural network to train | |
| update_order | the UpdatableVec for the backpropagation sequence | |
| learn_rate | the Real learning rate factor |
| ~BackPropagationAlgo | ( | ) |
Destructor.
| virtual void learn | ( | ) | [virtual] |
a single step of learning algorithm
Implements LearningAlgorithm.
| virtual void learn | ( | const Pattern & | ) | [virtual] |
Starts a single training step.
Implements LearningAlgorithm.
Calculate the Mean Square Error respect to Pattern passed
Implements LearningAlgorithm.
| void setRate | ( | Real | newrate | ) | [inline] |
Set the learning rate
| Real rate | ( | ) | [inline] |
return the learning rate
| void setMomentum | ( | Real | newmom | ) | [inline] |
Set the momentum value
| Real momentum | ( | ) | [inline] |
return the momentum
| void enableMomentum | ( | ) |
Enable the momentum
| void disableMomentum | ( | ) | [inline] |
Disable momentum
This method returns the deltas calculated by the Back-propagation Algorithm. These deltas are set every time new targets are defined for the output layer(s), which are then used to update network weights when the method learn() is called.
They are also useful to calculate the network performance, but for that it must be used outside the learning cycle (a full learning iteration, that corresponds to present the network with all the patterns of the train data set). For that you must call getError( Cluster * anyOutputCluster ) for each line of your training set (you'll get a RealVec with the deltas for each unit of the cluster considered).
Then you can use those values to calculate your desired performance measure.
For instance: if you use it to calculate the Mean Square Error (MSE) of the network for your train data set you must accumulate the square of the the getError( anyOutputCluster ) output for each line of the set, and at the end divide it by the length of that same set (by definition the MSE is the sum of the squared differences between the target and actual output of a sequence of values). Getting the Root Mean Squared Error (RMSE) from this is trivial (you just need to calculate the square root of the MSE).