--- Mark Kvale <[EMAIL PROTECTED]> wrote:
> a) AI::NeuralNet::Mesh - trains up multi-layer perceptrons, a type of
> feedforward neural net. It has good documentation. For your problem, I
> would reccommend a 3 layer net, with one input, one hidden and one
> output layer, with tanh activation fuctions.
Hi all,
Thanks to everyone for input. I decided to start first with AI::NeuralNet::Mesh
because it looks
easy, but so far, I can't seem to train my computer to learn binary. Below my signoff
is the full
program that I wrote. Here are the results of my test run:
Enter a four digit binary number (<ENTER> to quit): 0001
0 0 0 1: 9
Enter a four digit binary number (<ENTER> to quit): 0011
0 0 1 1: 12
Enter a four digit binary number (<ENTER> to quit): 1100
1 1 0 0: 12
Enter a four digit binary number (<ENTER> to quit): 1001
1 0 0 1: 12
Enter a four digit binary number (<ENTER> to quit): 1111
1 1 1 1: 16
Enter a four digit binary number (<ENTER> to quit): 0000
0 0 0 0: 7
Is my problem that I have too small of a dataset from which the net can extrapolate
results or is
it my failure to understand how the module functions? So I have layers, nodes per
layer, and
output nodes. I believe "output nodes" corresponds to how many potential outputs can
result from
one combination of inputs (each series of zeroes and ones represents one decimal
number), but I
don't necessarily know what the other values do.
Can you possibly give a brief explanation? I know I won't get exact results from a
neural net,
but I would like results that are close.
Cheers,
Ovid
#!/usr/bin/perl
use strict;
use AI::NeuralNet::Mesh;
my $net = AI::NeuralNet::Mesh->new(3,7,1);
if (!$net->load('binary.mesh')) {
$net->learn_set([
[qw/1 0 1 1/], [11],
[qw/0 0 1 0/], [2 ],
[qw/0 1 0 1/], [5 ],
[qw/1 1 0 0/], [12],
[qw/0 0 1 1/], [3 ],
[qw/1 1 0 1/], [13],
[qw/0 1 0 0/], [4 ],
[qw/0 1 1 0/], [6 ],
[qw/0 1 1 1/], [7 ],
[qw/1 0 1 0/], [10],
[qw/1 1 1 0/], [14],
[qw/0 0 0 1/], [1 ],
[qw/0 0 0 0/], [0 ],
[qw/1 0 0 1/], [9 ],
]);
$net->save('binary.mesh');
}
while (my $number = prompt()) {
printf "@$number: %d\n", $net->run($number)->[0];
}
sub prompt {
my $number;
do {
print "Enter a four digit binary number (<ENTER> to quit): ";
$number = <>;
chomp $number;
exit unless $number;
} until $number =~ /^[01]{4}$/;
return [split //, $number];
}
=====
Silence is Evil http://users.easystreet.com/ovid/philosophy/indexdecency.htm
Ovid http://www.perlmonks.org/index.pl?node_id=17000
Web Programming with Perl http://users.easystreet.com/ovid/cgi_course/
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com