AI-NeuralNet-Simple

 view release on metacpan or  search on metacpan

examples/logical_or.pl  view on Meta::CPAN

    $net->train([1,1],[0,1]);
    $net->train([1,0],[0,1]);
    $net->train([0,1],[0,1]);
    $net->train([0,0],[1,0]);
}

printf "Answer: %d\n",   $net->winner([1,1]);
printf "Answer: %d\n",   $net->winner([1,0]);
printf "Answer: %d\n",   $net->winner([0,1]);
printf "Answer: %d\n\n", $net->winner([0,0]);
use Data::Dumper;
print Dumper $net->infer([1,1]);

lib/AI/NeuralNet/Simple.pm  view on Meta::CPAN

faster, but it can have a tendancy to "overshoot" the answer when learning and
not learn as accurately.

=head2 C<infer(\@input)>

This method, if provided with an input array reference, will return an array
reference corresponding to the output values that it is guessing.  Note that
these values will generally be close, but not exact.  For example, with the 
"logical or" program, you might expect results similar to:

  use Data::Dumper;
  print Dumper $net->infer([1,1]);
  
  $VAR1 = [
          '0.00993729281477686',
          '0.990100297418451'
        ];

That clearly has the second output item being close to 1, so as a helper method
for use with a winner take all strategy, we have ...

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 2.573 seconds using v1.00-cache-2.02-grep-82fe00e-cpan-9f2165ba459b )