AI-ML

 view release on metacpan or  search on metacpan

C/nn.h  view on Meta::CPAN

REAL d_ReLU(REAL a, void* v);

REAL LReLU(REAL a, void *v);

REAL d_LReLU(REAL a, void *v);

REAL d_sigmoid(REAL a, void* v);

REAL exponential(REAL a, void* v);

Matrix *element_wise(Matrix *m, REAL f(REAL, void*), void* data);

Matrix *matrix_sigmoid(Matrix *m);

Matrix *matrix_ReLU(Matrix *m);

Matrix *matrix_d_ReLU(Matrix *m);

Matrix *matrix_LReLU(Matrix *m, REAL v);

Matrix *matrix_d_LReLU(Matrix *m, REAL v);

MANIFEST  view on Meta::CPAN

README.md
XS/ML.xs.inc
dist.ini
inc/MyBuilder.pm
lib/AI/ML.pm
lib/AI/ML/Expr.pm
lib/AI/ML/LinearRegression.pm
lib/AI/ML/LogisticRegression.pm
lib/AI/ML/NeuralNetwork.pm
run.sh
scripts/load_data.c
scripts/mnist.pl
t/00-report-prereqs.dd
t/00-report-prereqs.t
t/01-activation-funcs.t
t/02-cost_functions.t
t/03-mini-batch.t
t/04-linear-regression.t
t/05-logistic-regression.t
t/06-accuracy-precision-recall-f1.t
t/07-neural-network.t
t/08-gradient-checking.t_
t/W1_grad_check.csv
t/W2_grad_check.csv
t/W3_grad_check.csv
t/b1_grad_check.csv
t/b2_grad_check.csv
t/b3_grad_check.csv
t/dW1_grad_check.csv
t/dW2_grad_check.csv
t/dW3_grad_check.csv
t/dataset_adjetivos.csv
t/db1_grad_check.csv
t/db2_grad_check.csv
t/db3_grad_check.csv
t/logistic.csv
t/pred-nn.csv
t/w1.csv
t/w2.csv
t/x.csv
t/x_grad_check.csv
t/y.csv

META.json  view on Meta::CPAN

                     }
                  ],
                  "include_underscores" : 0
               },
               "Dist::Zilla::Role::MetaProvider::Provider" : {
                  "$Dist::Zilla::Role::MetaProvider::Provider::VERSION" : "2.002004",
                  "inherit_missing" : 1,
                  "inherit_version" : 1,
                  "meta_noindex" : 1
               },
               "Dist::Zilla::Role::ModuleMetadata" : {
                  "Module::Metadata" : "1.000033",
                  "version" : "0.006"
               }
            },
            "name" : "@Starter/MetaProvides::Package",
            "version" : "2.004003"
         },
         {
            "class" : "Dist::Zilla::Plugin::ShareDir",
            "name" : "@Starter/ShareDir",
            "version" : "6.010"

META.yml  view on Meta::CPAN

            -
              class: Dist::Zilla::Plugin::FinderCode
              name: '@Starter/MetaProvides::Package/AUTOVIV/:InstallModulesPM'
              version: '6.010'
          include_underscores: 0
        Dist::Zilla::Role::MetaProvider::Provider:
          $Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.002004'
          inherit_missing: '1'
          inherit_version: '1'
          meta_noindex: '1'
        Dist::Zilla::Role::ModuleMetadata:
          Module::Metadata: '1.000033'
          version: '0.006'
      name: '@Starter/MetaProvides::Package'
      version: '2.004003'
    -
      class: Dist::Zilla::Plugin::ShareDir
      name: '@Starter/ShareDir'
      version: '6.010'
    -
      class: Dist::Zilla::Plugin::ExecDir
      name: '@Starter/ExecDir'

lib/AI/ML/Expr.pm  view on Meta::CPAN

}



=head2 plot

=cut

sub plot {
    my ($x, $y, $theta, $file) = @_;
    my @xdata  = $x->vector_to_list();
    my @ydata  = $y->vector_to_list();
    my @thetas = $theta->vector_to_list();
    my $f = $thetas[0] . "+" . $thetas[1] . "*x";

    #print STDERR "$_\n" for(@xdata);
    #rint STDERR "$_\n" for(@ydata);
    #print STDERR "$f\n";
    #print STDERR "\n\nFILE == $file\n\n";
    my $chart = Chart::Gnuplot->new(
            output     => $file,
            title     => "Nice one",
            xlabel     => "x",
            ylabel     => "y"
    );

    my $points = Chart::Gnuplot::DataSet->new(
            xdata     => \@xdata,
            ydata     => \@ydata,
            style     => "points"
    );

    my $func = Chart::Gnuplot::DataSet->new(
            func     => $f
    );

    $chart->plot2d($points, $func);
}

scripts/mnist.pl  view on Meta::CPAN

use AI::ML::NeuralNetwork;
    
my %opt = (
        "train-images" => "train-images-idx3-ubyte",
        "train-labels" => "train-labels-idx1-ubyte",
        "test-images"  => "t10k-images-idx3-ubyte",
        "test-labels"  => "t10k-labels-idx1-ubyte"
    );


_load_data();


sub _load_data {
    _download_data();
    # compile c file
    system("gcc load_data.c -o load");

    my @matrices;
    
    for my $key ( keys %opt ) {
        my (undef, $type) = split /-/, $key;
        system("gunzip $opt{$key}.gz");
        system("./load $type $opt{$key} $key.csv");
    }
}

sub _download_data{
    my $http = HTTP::Tiny->new();

    my $url = "http://yann.lecun.com/exdb/mnist";

    my $res;
    for my $key ( keys %opt ) {
        my $file = "$url/$opt{$key}.gz";
        my $ff = File::Fetch->new(uri => $file);
        my $aux = $ff->fetch() or die $ff->error;
        #print "$file\n";

t/00-report-prereqs.t  view on Meta::CPAN

# Add dynamic prereqs to the included modules list (if we can)
my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml';
my $cpan_meta_error;
if ( $source && $HAS_CPAN_META
    && (my $meta = eval { CPAN::Meta->load_file($source) } )
) {
    $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs);
}
else {
    $cpan_meta_error = $@;    # capture error from CPAN::Meta->load_file($source)
    $source = 'static metadata';
}

my @full_reports;
my @dep_errors;
my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs;

# Add static includes into a fake section
for my $mod (@include) {
    $req_hash->{other}{modules}{$mod} = 0;
}

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

( run in 1.710 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )