NAME
AI::NNFlex::Hopfield - a fast, pure perl Hopfield network simulator
SYNOPSIS
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();
DESCRIPTION
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.
CONSTRUCTOR
AI::NNFlex::Hopfield->new();
AI::NNFlex::Dataset
new ( [[INPUT VALUES],[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
OUTPUT VALUES
These are the intended or target output values. Comma separated. These will be used by ::learn
METHODS
This is a short list of the main methods implemented in AI::NNFlex::Hopfield.
AI::NNFlex::Hopfield
add_layer
Syntax:
$network->add_layer( nodes=>NUMBER OF NODES IN LAYER );
init
Syntax:
$network->init();
Initialises connections between nodes.
run
$network->run($dataset)
Runs the dataset through the network and returns a reference to an array of output patterns.
EXAMPLES
See the code in ./examples.
PREREQs
Math::Matrix
ACKNOWLEDGEMENTS
SEE ALSO
AI::NNFlex
AI::NNFlex::Backprop
TODO
More detailed documentation. Better tests. More examples.
CHANGES
v0.1 - new module
COPYRIGHT
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.
CONTACT
charlesc@nnflex.g0n.net