This module is the momentuma algorithm for NNFlex. it is included in the NNFlex namespace at run time. See documentation below for standard methods.
The momentum module is a modified version of the backprop module (literally - I copied it then did '1,$s/backprop/momentum/g'!)
The only difference is that momentum retains a copy of node dW at the end of the learning cycle. This is then used in the dW calculation for the next pass. The upshot of this is that if a large change took place last time, we're evidently still in the 'large changes' stage of learning, so it should be a large change this time as well.
Copyright (c) 2004-2005 Charles Colbourn. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Takes as a parameter a reference to the desired output pattern, performs one learning pass back through the network with normal momentum procedures to bring the network closer to convergence.
This package is imported into the NNFlex namespace at runtime via a parameter to the network object.
syntax: $network->learn([0,1,1,0]);
learn is the main method of the momentum module. It calls calc_error to calculate the output error, calls output_adjust to adjust the weights from the last hidden to the output layer, then calls hidden_adjust to adjust the weights to the hidden layers finally it returns the network sqrd error.
If you have a 3 layer network this will be called to delta the weights between input and hidden layers.
If you have a 4 layer network it will be called to delta the weights between the two hidden layers, and the input to hidden layer
Calculates the network squared error after a single momentum pass. Internal to ::momentum
11 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
=over without closing =back
To install AI::NNFlex, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AI::NNFlex
CPAN shell
perl -MCPAN -e shell install AI::NNFlex
For more information on module installation, please visit the detailed CPAN module installation guide.