Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^2: AI::NNEasy to setup fast a Neural Network using just Perl and XS.

by gmpassos (Priest)
on Jan 15, 2005 at 18:49 UTC ( #422536=note: print w/ replies, xml ) Need Help??

in reply to Re: AI::NNEasy to setup fast a Neural Network using just Perl and XS.
in thread AI::NNEasy to setup fast a Neural Network using just Perl and XS.

Yes, I'm interested into this new methods. And if you want any help to port resource to NNFlex just ask.

Perl rox! ;-P

Graciliano M. P.
"Creativity is the expression of liberty".

Comment on Re^2: AI::NNEasy to setup fast a Neural Network using just Perl and XS.
Replies are listed 'Best First'.
Re^3: AI::NNEasy to setup fast a Neural Network using just Perl and XS.
by g0n (Priest) on Jan 16, 2005 at 14:32 UTC
    OK, I've uploaded AI-NNFlex-0.11 to CPAN, with support for datasets a little bit like the Xerion approach. It makes the UI quite a bit friendlier - if you look at ./examples/ you'll see what I mean. PNG support has been put into ::draw and the lesioning method has been implemented. You can now damage the network probabilistically on a network-wide, layer or node basis.

    I've cleaned up some of the nastiest perldoc sections aswell.

    Quick question - I haven't done any work on the XS issue. I've never encountered XS before - does it have any prerequisites? Like a C compiler?


      XS is like another mini language. First you need a C compiler, actually you need the same compiler used to compile your Perl. So, on Linux is easy since is always with GCC, but on Win32 you will need Microsoft Visual C++ 6+ (not free) if you got Perl from Active State, or MingW, that is GCC for Win32.

      Than you need to learn how Perl works with C and the resources for that (perlapi). So, take a look in the docs: perlapi, perlguts, perlxstut. All of that you can find better at

      If you already know C, I think that the best way to you make XS functions with Perl is getting as examaple the sub{C} methods that you can find in the sources of AI::NNEasy. Because this functions have a Perl and a C version, so you can compare them and understand better what the C macros does. Also the Class::HPLOO syntax is easy like sugar, since you only need to write the function, all the rest Class::HPLOO will write for you, converting to Inline::C, than Inline will convert to XS, and from XS is with Perl. So, the code below is 100% complete, you just need to have a C compiler well installed:

      use Class::HPLOO ; class Foo { sub[C] int add( int x , int y ) { int ret = x + y ; return ret ; } }
      Now you just need to run the code above, and the rest is automatically.

      Other thing, your module is inside AI::NNEasy starting from the class AI::NNEasy::NN. So, if you move this class (and the sub classes sinde AI::NNEasy::NN::*) to your project you will have your modules with the resources that I have added to it. I let it separated to be more easy to you to get back the work that I did, so be free to use it. ;-P

      Graciliano M. P.
      "Creativity is the expression of liberty".

        Thanks for that.

        It'll take a bit of time to explore this. I'm not sure I want to use HPLoo, since I intended NNFlex to be usable as a fairly simple teaching framework. The XS & HPLoo code is quite a bit more complex than the pure perl!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://422536]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2016-02-06 16:10 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (233 votes), past polls