Ok I have only been into Perl for a couple weeks (I am still technically on the Llama book), but when I found out that their were all these modules that let me experiment with the fabric of time and space, and artificial intelligence, I could not resist. Anyways I have forgetfullness down to 0.0000000 and I made a script I think is kind of neat. Anyways, the quantum and neural network modules go together like ham and swiss. Yes I know its just adding and removing from the tutorial program on the cpan. But I want to show everyone how great quantum and neural net modules mix. I imagine genetic algorithms would be fun to test to, but they do not go as smoothly with Quamtum mods as the NN`s do. I will be experimenting and adding to this alot tonight, and in the next few days, to see what else I can create. Any suggestions into ways I can take this farther, or ways a more experienced programmer could make this better, or even usefull. Would also be interesting. So without further adew, here we go..
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";

In reply to Zero forgetfullness by Odinator

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.