AI-Nerl
view release on metacpan or search on metacpan
Holder, and derivatives of that collection of files created through
textual modification.
- "Standard Version" refers to such a Package if it has not been modified,
or has been modified in accordance with the wishes of the Copyright
Holder.
- "Copyright Holder" is whoever is named in the copyright or copyrights for
the package.
- "You" is you, if you're thinking about copying or distributing this Package.
- "Reasonable copying fee" is whatever you can justify on the basis of media
cost, duplication charges, time of people involved, and so on. (You will
not be required to justify it to the Copyright Holder, but only to the
computing community at large as a market that must bear the fee.)
- "Freely Available" means that no fee is charged for the item itself, though
there may be fees involved in handling the item. It also means that
recipients of the item may redistribute it under the same conditions they
received it.
1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.
lib/AI/Nerl.pm view on Meta::CPAN
Zach Morgan
=cut
has scale_input => (
is => 'ro',
isa => 'Num',
required => 0,
default => 0,
);
has l2 => ( #hidden layer.
is => 'ro',
isa => 'Num',
default => 30,
);
has [qw/ train_x
train_y /] => (
is => 'ro',
isa => 'PDL',
required => 0, #training can be done manually.
);
has [qw/ test_x cv_x
test_y cv_y /] => (
is => 'ro',
isa => 'PDL',
required => 0,
);
has network => (
required=>0,
is => 'rw',
isa => 'AI::Nerl::Network',
);
has passes=> (
is => 'rw',
isa => 'Int',
default => 10,
);
has basis => (
is => 'ro',
isa => 'AI::Nerl',
required => 0,
);
#initialize $self->network, but don't train.
# any parameters AI::Nerl::Network takes are fine here.
sub init_network{
my $self = shift;
my %nn_params = @_;
#input layer size:
unless ($nn_params{l1}){
if ($self->basis){
lib/AI/Nerl/Network.pm view on Meta::CPAN
This package is free software; you can redistribute it and/or modify it under the
same terms as Perl itself.
=cut
# Simple nn with 1 hidden layer
# train with $nn->train(data,labels);
has scale_input => (
is => 'ro',
required => 0,
isa => 'Num',
default => 0,
);
# number of input,hidden,output neurons
has [qw/ l1 l2 l3 /] => (
is => 'ro',
isa => 'Int',
);
( run in 0.524 second using v1.01-cache-2.11-cpan-0a6323c29d9 )