AI-Perceptron

 view release on metacpan or  search on metacpan

examples/and.pl  view on Meta::CPAN

#!/usr/bin/perl
#
# And - and function using a perceptron
# Steve Purkis <spurkis@epn.nu>
# July 20, 1999
##


use Data::Dumper;
use AI::Perceptron;

print( "Example: training a perceptron to recognize an 'AND' function.\n",
       "usage: $0 [<threshold> <weight1> <weight2>]\n" );

my $p = AI::Perceptron->new
                      ->num_inputs( 2 )
                      ->learning_rate( 0.1 );
if (@ARGV) {
    $p->threshold( shift(@ARGV) )

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

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