AI-NeuralNet-FastSOM
view release on metacpan or search on metacpan
0.13 Mon Aug 17 08:42:37 2009
- fixed perl version check in Makefile.PL
0.12 Sat Aug 15 14:24:50 2009
- will now pass -Wall -Wextra -ansi -Wdeclaration-after-statement
(locally anyway)
- wrapped newSVpvs in INT2PTR to hopefully satisfy some platforms
- bumped perl require back up to 5.8.0 for now
- defined PERL_MAGIC_tied for older perls
- changed hv_fetchs() to hv_fetch() for older perls
- hacked in defines for Newx() and friends for older perls
- changed newSVpvs() to newSVpvn() for older perls
- created seperate typemap for older perls, along with Makefile.PL
modification to use it before 5.8.0
- added requirement for Storable which is non-core in older perls
- moved perl require back down to 5.6.2
0.11 Sun Aug 9 10:04:19 2009
- casting newSVpvs() to SV* to satisfy at least one platform
- added 'const char *' to typemap for older perls
- removed a few unneeded casts to internal types
- moved DESTROY methods to superclass, thus fixing missing
- removed another temp AV in _bmu_guts(), fixing another
memory leak
- added pointer <-> IV conversions, hopefully fixing tons of
warnings on platforms where ivsize != ptrsize
- added macros to speed up pointer conversions
- consolidated bmu code in ::FastSOM
0.08 Fri Jul 31 16:17:32 2009
- removed leading underscore from struct member names
- removed all // comments, just in case...
- changed all native type (int,double) to perl types (IV,NV)
- fixed couple of instances of calling back to perl to get
stuff from c structs
- reworked Storable support
0.07 Sat Jul 25 14:18:03 2009
- clean up things a bit
- now using Atol() instead of atoi()
- now using Drand01() instead of rand()
- now using seedDrand01() instead of srand()
- fixed problem with not using all training vectors, or some twice
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More qw(no_plan);
BEGIN { use_ok('AI::NeuralNet::FastSOM::Hexa') };
######
use Storable qw/store/;
{
my $nn = AI::NeuralNet::FastSOM::Hexa->new(
output_dim => 6,
),
'neighbors 0+1'
);
}
{
my $nn = AI::NeuralNet::FastSOM::Hexa->new(
output_dim => 3,
input_dim => 3,
sigma0 => 4,
); # make change network-wide
$nn->initialize( [ 0, -1, 1 ] );
$nn->train( 100, [ 1, 1, 1 ] );
for my $x ( 0 .. $nn->diameter - 1 ) {
for my $y ( 0 .. $nn->diameter - 1 ) {
ok(
(! grep { $_ < 0.9 } @{ $nn->value( $x, $y ) }),
"$x, $y: vector above 0.9"
);
}
t/hexa_retrieve.t view on Meta::CPAN
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More qw(no_plan);
BEGIN { use_ok('AI::NeuralNet::FastSOM::Hexa') };
######
use Storable 'retrieve';
ok( open(FILE, '< t/save_hexa_bmu.bin'), 'hexa open' );
my ( $bmu_x, $bmu_y ) = <FILE>;
t/orig/hexa.t view on Meta::CPAN
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More qw(no_plan);
BEGIN { use_ok('AI::NeuralNet::FastSOM::Hexa') };
######
#use Data::Dumper;
{
my $nn = new AI::NeuralNet::FastSOM::Hexa (output_dim => 6,
input_dim => 3);
t/orig/hexa.t view on Meta::CPAN
ok (eq_array ( $nn->neighbors (0, 3, 3),
[
[3, 3, 0 ],
]), 'neighbors 0+1');
}
{
my $nn = new AI::NeuralNet::FastSOM::Hexa (output_dim => 3,
input_dim => 3,
sigma0 => 4); # make change network-wide
$nn->initialize ( [ 0, -1, 1 ] );
$nn->train (100, [ 1, 1, 1 ]);
# warn Dumper $nn;
foreach my $x (0 .. $nn->diameter -1) {
foreach my $y (0 .. $nn->diameter -1 ) {
ok ( (! grep { $_ < 0.9 } @{ $nn->value ( $x, $y ) }) , "$x, $y: vector above 0.9");
}
}
t/orig/rect.t view on Meta::CPAN
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More qw(no_plan);
BEGIN { use_ok('AI::NeuralNet::FastSOM::Rect') };
######
#use Data::Dumper;
{
my $nn = new AI::NeuralNet::FastSOM::Rect (output_dim => "5x6",
input_dim => 3);
t/orig/torus.t view on Meta::CPAN
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More qw(no_plan);
BEGIN { use_ok('AI::NeuralNet::FastSOM::Torus') };
######
#use Data::Dumper;
{
my $nn = new AI::NeuralNet::FastSOM::Torus (output_dim => "5x6",
input_dim => 3);
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More qw(no_plan);
BEGIN { use_ok('AI::NeuralNet::FastSOM::Rect') };
######
use AI::NeuralNet::FastSOM::Utils;
use Storable qw/store/;
{
my $nn = AI::NeuralNet::FastSOM::Rect->new(
t/rect_retrieve.t view on Meta::CPAN
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More qw(no_plan);
BEGIN { use_ok('AI::NeuralNet::FastSOM::Rect') };
######
use Storable 'retrieve';
ok( open(FILE, '< t/save_rect_bmu.bin'), 'rect open' );
my ( $bmu_x, $bmu_y ) = <FILE>;
t/torus_retrieve.t view on Meta::CPAN
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More qw(no_plan);
BEGIN { use_ok('AI::NeuralNet::FastSOM::Torus') };
######
use Storable 'retrieve';
ok( open(FILE, '< t/save_torus_bmu.bin'), 'torus open' );
my ( $bmu_x, $bmu_y ) = <FILE>;
( run in 6.175 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )