AI-Perceptron
view release on metacpan or search on metacpan
#!/usr/bin/perl
=head1 NAME
Build.PL - Build script generator for AI::Perceptron
=head1 SYNOPSIS
perl Build.PL
./Build
./Build test
./Build install
=cut
use strict;
use warnings;
use Module::Build;
my $build = Module::Build->new
----------------
Revision history for AI::Perceptron.
1.0
+ moved to Module::Build
+ restructured project directory tree
+ fixed bug in algorithm [reported by Himanshu Garg]
+ refactored api & code, things should be more obvious now.
+ more documentation & bugfixes
+ wrote a proper test-suite
+ weights & threshold no longer random
0.01
+ original dist created Fri Feb 18 16:05:09 2000 by h2xs 1.19
+ project began July 20, 1999, originally designed on a napkin which,
sadly enough, I probably still have lying around somewhere.
t/01_basic.t view on Meta::CPAN
#!/usr/bin/perl
##
## Test suite for AI::Perceptron
##
use Test::More 'no_plan'; # tests => 3;
use_ok( 'AI::Perceptron' );
my $p = AI::Perceptron->new
->num_inputs( 2 )
->learning_rate( 0.01 )
->threshold( 0.8 )
->weights([ -0.5, 0.5 ])
->max_iterations( 20 );
#!/usr/bin/perl
##
## API tests for AI::Perceptron
##
use Test::More 'no_plan'; # tests => 3;
use AI::Perceptron;
my $p = AI::Perceptron->new
->num_inputs( 3 )
->learning_rate( 0.01 )
->threshold( 0.02 )
->weights([ 0.1, 0.2, -0.3 ])
->max_iterations( 5 )
->training_examples( [ -1 => 1, 2 ] );
( run in 0.753 second using v1.01-cache-2.11-cpan-87723dcf8b7 )