AI-NNFlex

 view release on metacpan or  search on metacpan

CHANGES  view on Meta::CPAN

Put the pod documentation back in Dataset.pm :-)


###############################################################
0.21
20050313

Rewrote all the pod. Its probably a bit sparse now, but its 
much more accurate.

Removed the eval calls from feedforward, backprop & momentum
for speed.

Implemented fahlman constant. This eliminates the 'flat spot'
problem, and gets the network to converge more reliably. XOR
seems to never get stuck with this set to 0.1. as a bonus, its 
also about 50% faster (do you sense a theme developing here?)

Removed momentum module (well, removed backprop module and 
renamed momentum module in fact). There were few code differences
and its easier to maintain this way. Default option is vanilla

lib/AI/NNFlex/Backprop.pm  view on Meta::CPAN

#					function slope instead
#					of hardcoded 1-y*y
#
# 1.2	20050218	CColbourn	Mod'd to change weight
#					indexing to array for
#					nnflex 0.16
#
# 1.3	20050307	CColbourn	packaged as a subclass of NNFLex
#
# 1.4	20050313	CColbourn	modified the slope function call
#					to avoid using eval
#
# 1.5	20050314	CColbourn	applied fahlman constant
# 					Renamed Backprop.pm, see CHANGES
#
##########################################################
# ToDo
# ----
#
#
###########################################################

lib/AI/NNFlex/Feedforward.pm  view on Meta::CPAN

#
# 1.4	20050302	CColbourn	Fixed a problem that allowed
#					activation to flow even if a
#					node was lesioned off
#
# 1.5	20050308	CColbourn	Made a separate class as part
#					of NNFlex-0.2
#
# 1.6	20050313	CColbourn	altered syntax of activation
#					function call to get rid of
#					eval
#
##########################################################
# ToDo
# ----
#
#
###########################################################
#
package AI::NNFlex::Feedforward;

lib/AI/NNFlex/Feedforward.pm  view on Meta::CPAN

				$nodeCounter++;	
			}

			if ($node->{'active'})
			{
				my $value = $totalActivation;

				my $function = $node->{'activationfunction'};
				#my $functionCall ="\$value = \$network->$function(\$value);";

				#eval($functionCall);
				$value = $network->$function($value);
				$node->{'activation'} = $value;
			}
			if (scalar @debug> 0)
			{$network->dbug("Final activation of ".$node->{'nodeid'}." = ".$node->{'activation'},3);}
		}
	}



t/Hopfield.t  view on Meta::CPAN

# example script to build a hopfield net
use strict;
use AI::NNFlex::Hopfield;
use AI::NNFlex::Dataset;
use Test;


BEGIN{plan tests=>4}
my $matrixpresent = eval("require(Math::Matrix)");
my $matrixabsent = !$matrixpresent;

my $network = AI::NNFlex::Hopfield->new();

skip($matrixabsent,$network);


$network->add_layer(nodes=>2);
$network->add_layer(nodes=>2);



( run in 1.350 second using v1.01-cache-2.11-cpan-98e64b0badf )