/home/cpanrun/depot/main/contrib-patched/perl/CPAN/src/AI-NNFlex/blib/lib/AI/NNFlex/momentum.pm


AI::NNFlex::momentum

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.


AI::NNFlex::momentum::learn

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]);


AI::NNFlex::momentum::learn

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.


AI::NNFlex::momentum::hiddenToOutput

Performs weight changes for all nodes in the output layer nodes 'connectedNodesWest' attributes, based on momentum Output weights delta


AI::NNFlex::momentum::hiddenOrInputToHidden

This subroutine calculates and applies delta weights that are not directly derived from the output layer. I.e. if you have a 2 layer network this will never get called.
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


AI::NNFlex::momentum::sqrErr

Calculates the network squared error after a single momentum pass. Internal to ::momentum

 /home/cpanrun/depot/main/contrib-patched/perl/CPAN/src/AI-NNFlex/blib/lib/AI/NNFlex/momentum.pm