AI::NNFlex::Hopfield - a fast, pure perl Hopfield network simulator
use AI::NNFlex::Hopfield; my $network = AI::NNFlex::Hopfield->new(config parameter=>value); $network->add_layer(nodes=>x); $network->init(); use AI::NNFlex::Dataset; my $dataset = AI::NNFlex::Dataset->new([ [INPUTARRAY], [INPUTARRAY]]); $network->learn($dataset); my $outputsRef = $dataset->run($network); my $outputsRef = $network->output();
AI::NNFlex::Hopfield is a Hopfield network simulator derived from the AI::NNFlex class. THIS IS THE FIRST ALPHA CUT OF THIS MODULE! Any problems, let me know and I'll fix them.
Hopfield networks differ from feedforward networks in that they are effectively a single layer, with all nodes connected to all other nodes (except themselves), and are trained in a single operation. They are particularly useful for recognising corrupt bitmaps etc. I've left the multi layer architecture in this module (inherited from AI::NNFlex) for convenience of visualising 2d bitmaps, but effectively its a single layer.
Full documentation for AI::NNFlex::Dataset can be found in the modules own perldoc. It's documented here for convenience only.
new ( [[INPUT VALUES],[INPUT VALUES], [INPUT VALUES],[INPUT VALUES],..])
These should be comma separated values. They can be applied to the network with ::run or ::learn
These are the intended or target output values. Comma separated. These will be used by ::learn
This is a short list of the main methods implemented in AI::NNFlex::Hopfield.
Syntax: $network->add_layer( nodes=>NUMBER OF NODES IN LAYER );
Syntax: $network->init();
Initialises connections between nodes.
$network->run($dataset)
Runs the dataset through the network and returns a reference to an array of output patterns.
See the code in ./examples.
Math::Matrix
AI::NNFlex AI::NNFlex::Backprop
More detailed documentation. Better tests. More examples.
v0.1 - new module
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.
charlesc@nnflex.g0n.net
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.