Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Zero forgetfullness

by Odinator (Initiate)
on Nov 14, 2008 at 23:58 UTC ( [id://723753]=CUFP: print w/replies, xml ) Need Help??

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";

Replies are listed 'Best First'.
Re: Zero forgetfullness
by zentara (Archbishop) on Nov 15, 2008 at 14:37 UTC
    Pretty imaginative stuff, ++. Live long and prosper. ( Will Star Wars and Star Trek ever combine into a single movie event? Maybe the Enterprise can be teleported thru a quantuum time hole, to help fight the Empire? Or would the Enterprise BE an ally of the Empire? The plot thickens..... a split in the Federation...half supporting the Empire, half opposing it. The final showdown occurs on a planet named Armageddon. :-)

    I'm not really a human, but I play one on earth Remember How Lucky You Are
Re: Zero forgetfullness
by Odinator (Initiate) on Nov 15, 2008 at 00:21 UTC
    just to let everyone know, I may have posted this code in the wrong place, however I do not think so. Because in the "code" area for modules and frameworks, that is a little large. The "obfuscation" area does not work either. So this is like a small collection of snippets in a couple paragraphs of code that can be used to add quantum and neural networkin... ahh screw it, I posted in the wrong place when I had a viable source of info to turn to that would tell me where to post... the perl police are coming to take me away now!!!! I should have posted this in code, sorry. May the force be with you.
Re: Zero forgetfullness
by eric256 (Parson) on Nov 17, 2008 at 16:36 UTC

    Hey this is pretty....interesting! ;) I have no idea how it does anything at all though. Could you give a little example of what its doing?


    ___________
    Eric Hodges
      I am currently working on making it do something, that was just the very sorta rough sketch of my thoughts that will ultimately be something useful. Its purely scientific, theoretical and needs to become practical. Totally right. I will be working this into some cgi, or data mining scripts to see if I can make them do anything cooler than they allready can, no exact time frame though. That little snippet was just to fuel some imaginations for now. Thankyou for your input :)
Re: Zero forgetfullness
by wilsond (Scribe) on Jan 16, 2009 at 06:45 UTC

    This is what I got:

    Learning took 1024 loops and 3 wallclock secs (2.580 usr + 0.010 sys += 2.590 CPU) Forgetfulness: -0.0000000000 unit mechanics! mechanics! mechanics! mechanics!

    What's it supposed to do?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://723753]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-25 07:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found