File: examples/ex_aln.pl Author: Josiah Bryan, jdb@wcoil.com Desc: This is a simple example of a _basic_ ALN implementation in under 210 lines of code. In this demo we make use of the custom node connector as described in the POD. We also insert our own method over the node's internal adjust_weight() method to make ALN learning a bit easire. This demo also adds a temporary method to the network to print the logical type of each node, called print_aln(); print_aln() prints simple diagram of the network similar to this (this is for a $net=Tree(8,1) with $net->learn([1,1,0,1,0,1,1,1],[0]), and each line represents a layer): L R L L L L L L OR OR OR OR OR OR AND All the standard methods that work on AI::NeuralNet::Mesh work on the object returned by Tree(). load() and save() will correctly preserve the gate structure and types of your network. learn_set() and everything else works pretty much as expected. Only thing that is useless is the crunch() method, as this only takes binary inputs. But...for those of you who couldnt live without integers in your network...I'm going to create a small package in the next week, AI::NeuralNet::ALNTree, from this code. It will which includes a integer-vectorizer (convert your integers into bit vectors), a bit vector class to play with, as well as support for concating and learning bit vectors. But, for now, enjoy this! This file contains just a simple, functional, ALN implementation. Enjoy!
1 POD Error
The following errors were encountered while parsing the POD:
=begin without a target?
To install AI::NeuralNet::Mesh, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AI::NeuralNet::Mesh
CPAN shell
perl -MCPAN -e shell install AI::NeuralNet::Mesh
For more information on module installation, please visit the detailed CPAN module installation guide.