AI-NeuralNet-Hopfield
view release on metacpan or search on metacpan
lib/AI/NeuralNet/Hopfield.pm view on Meta::CPAN
my $identity = &identity($m3->{_rows});
my $m4 = &subtract($m3, $identity);
my $m5 = &add($self->matrix, $m4);
$self->matrix($m5);
}
sub evaluate() {
my $self = shift;
my @pattern = @_;
my @output = ();
my $input_matrix = &convert_array($self->matrix_rows, $self->matrix_cols, @pattern);
for (my $col = 1; $col <= ($#pattern + 1); $col++) {
my $column_matrix = &get_col($self, $col);
lib/AI/NeuralNet/Hopfield.pm view on Meta::CPAN
The training method configurates the network memory.
my @input_1 = qw(true true false false);
$hop->train(@input_1);
=cut
=head2 Evaluation
The evaluation method compares the new input with the information stored in the matrix memory.
The output is a new array with the boolean evaluation of each neuron.
my @input_2 = qw(true true true false);
my @result = $hop->evaluate(@input_2);
=cut
=head1 AUTHOR
Felipe da Veiga Leprevost, C<< <leprevost at cpan.org> >>
=head1 BUGS
t/manifest.t view on Meta::CPAN
use 5.006;
use strict;
use warnings FATAL => 'all';
use Test::More;
unless ( $ENV{RELEASE_TESTING} ) {
plan( skip_all => "Author tests not required for installation" );
}
my $min_tcm = 0.9;
eval "use Test::CheckManifest $min_tcm";
plan skip_all => "Test::CheckManifest $min_tcm required" if $@;
ok_manifest();
( run in 0.557 second using v1.01-cache-2.11-cpan-98e64b0badf )