use AI::NeuralNet::BackProp; use Quantum::Superpositions; use Quantum::Entanglement qw(:DEFAULT :complex :QFT); # Create a new network with 1 layer, 5 inputs, and 5 outputs. my $net = new AI::NeuralNet::BackProp(1,5,5); # Add a small amount of randomness to the network $net->random(0.001); # Demonstrate a simple learn() call my @inputs = all( 0,0,1,1,1 ); my @outputs = any( 1,0,1,0,1 ); print $net->learn(\@inputs, \@outputs),"\n"; # Create a data set to learn my @set = entangle( [ 2,2,3,4,1 ], [ 1,1,1,1,1 ], [ 1,1,1,1,1 ], [ 0,0,0,0,0 ], [ 1,1,1,0,0 ], [ 0,0,0,1,1 ] ); # Demo learn_set() my $f = $net->learn_set(\@set); print "Forgetfulness: $f unit\n"; # Crunch a bunch of strings and return array refs my $phrase1 = $net->crunch("Odin is a husky!"); my $phrase2 = $net->crunch("Star is a husky."); my $phrase3 = $net->crunch("Rukia is also a husky"); my $phrase4 = $net->crunch("Sorry, are you more of a cat perso +n?"); # Make a data set from the array refs my @phrases = any( $phrase1, $phrase2, $phrase3, $phrase4 ); # Learn the data set $net->learn_set(\@phrases); # Run a test phrase through the network my $test_phrase = eigenstates($net->crunch("I love neural netw +orking and quantum mechanics!")); my $result = $net->run($test_phrase); print all($net->uncrunch($result)),"\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Zero forgetfullness
by zentara (Cardinal) on Nov 15, 2008 at 14:37 UTC | |
|
Re: Zero forgetfullness
by Odinator (Initiate) on Nov 15, 2008 at 00:21 UTC | |
|
Re: Zero forgetfullness
by eric256 (Parson) on Nov 17, 2008 at 16:36 UTC | |
by Odinator (Initiate) on Nov 20, 2008 at 23:13 UTC | |
|
Re: Zero forgetfullness
by wilsond (Scribe) on Jan 16, 2009 at 06:45 UTC |