AI::NNEasy

Define, learn and use easy Neural Networks of different types using a portable code in Perl and XS.
Download

AI::NNEasy Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Graciliano M. P.
  • Publisher web site:
  • http://search.cpan.org/~gmpassos/

AI::NNEasy Tags


AI::NNEasy Description

Define, learn and use easy Neural Networks of different types using a portable code in Perl and XS. AI::NNEasy is a Perl module to define, learn and use easy Neural Networks of different types using a portable code in Perl and XS.The main purpose of this module is to create easy Neural Networks with Perl.The module was designed to can be extended to multiple network types, learning algorithms and activation functions. This architecture was 1st based in the module AI::NNFlex, than I have rewrited it to fix some serialization bugs, and have otimized the code and added some XS functions to get speed in the learning process. Finally I have added an intuitive inteface to create and use the NN, and added a winner algorithm to the output.I have writed this module because after test different NN module on Perl I can't find one that is portable through Linux and Windows, easy to use and the most important, one that really works in a reall problem.With this module you don't need to learn much about NN to be able to construct one, you just define the construction of the NN, learn your set of inputs, and use it.USAGEHere's an example of a NN to compute XOR: use AI::NNEasy ; ## Our maximal error for the output calculation. my $ERR_OK = 0.1 ; ## Create the NN: my $nn = AI::NNEasy->new( 'xor.nne' , ## file to save the NN. , ## Output types of the NN. $ERR_OK , ## Maximal error for output. 2 , ## Number of inputs. 1 , ## Number of outputs. , ## Hidden layers. (this is setting 1 hidden layer with 3 nodes). ) ; ## Our set of inputs and outputs to learn: my @set = ( => , => , => , => , ); ## Calculate the actual error for the set: my $set_err = $nn->get_set_error(@set) ; ## If set error is bigger than maximal error lest's learn this set: if ( $set_err > $ERR_OK ) { $nn->learn_set( @set ) ; ## Save the NN: $nn->save ; } ## Use the NN: my $out = $nn->run_get_winner() ; print "0 0 => @$out " ; ## 0 0 => 0 my $out = $nn->run_get_winner() ; print "0 1 => @$out " ; ## 0 1 => 1 my $out = $nn->run_get_winner() ; print "1 0 => @$out " ; ## 1 0 => 1 my $out = $nn->run_get_winner() ; print "1 1 => @$out " ; ## 1 1 => 0 ## or just interate through the @set: for (my $i = 0 ; $i < @set ; $i+=2) { my $out = $nn->run_get_winner($set) ; print "@{$set}) => @$out " ; } Requirements: · Perl


AI::NNEasy Related Software