AI-ActivationFunctions

 view release on metacpan or  search on metacpan

AI-ActivationFunctions-0.01/AI-ActivationFunctions-0.01/t/pdl.t  view on Meta::CPAN

#!/usr/bin/perl
use strict;
use warnings;
use Test::More;

# Pular se PDL não estiver instalado
BEGIN {
    eval {
        require PDL;
        1;
    } or do {
        plan skip_all => 'PDL não está instalado';
        exit 0;
    };
}

# Continuar com os testes
plan tests => 1;

t/pdl.t  view on Meta::CPAN

#!/usr/bin/perl
use strict;
use warnings;
use Test::More;

# Pular se PDL não estiver instalado
BEGIN {
    eval {
        require PDL;
        1;
    } or do {
        plan skip_all => 'PDL não está instalado';
        exit 0;
    };
}

# Continuar com os testes
plan tests => 1;

test_minimal.pl  view on Meta::CPAN

}

# Teste
print "   relu(5) = " . relu(5) . " (esperado: 5)\n";
print "   relu(-3) = " . relu(-3) . " (esperado: 0)\n";
print "   tanh(0) = " . tanh_simple(0) . " (esperado: ~0)\n";

print "\n2. Agora testando o módulo...\n";

# Tente carregar o módulo
eval {
    # Adiciona lib ao @INC
    unshift @INC, 'lib';
    require AI::ActivationFunctions;
    print "   ✓ Módulo carregado\n";
    
    # Testa uma função
    my $test = AI::ActivationFunctions::relu(10);
    print "   ✓ relu(10) = $test\n";
    
    1;

test_quick.pl  view on Meta::CPAN

#!/usr/bin/perl
use strict;
use warnings;
use FindBin qw($Bin);
use lib "$Bin/lib";

# Testar se o módulo carrega
eval {
    require AI::ActivationFunctions;
    AI::ActivationFunctions->import(qw(relu prelu sigmoid));
    1;
} or die "Erro ao carregar módulo: $@";

print "=== Teste Rápido ===\n\n";

print "relu(5) = " . AI::ActivationFunctions::relu(5) . "\n";
print "relu(-3) = " . AI::ActivationFunctions::relu(-3) . "\n";
print "prelu(-2, 0.1) = " . AI::ActivationFunctions::prelu(-2, 0.1) . "\n";



( run in 1.154 second using v1.01-cache-2.11-cpan-acf6aa7dc9e )