Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Neural Nets

by gri6507 (Deacon)
on Apr 07, 2005 at 13:48 UTC ( #445659=perlquestion: print w/replies, xml ) Need Help??
gri6507 has asked for the wisdom of the Perl Monks concerning the following question:

Fellow Monks,

I am currently participating in a Neural Networks Controls class at school. As the name implies, the purpose of the class is to design Neural Networks to control complex systems. The professor has left most of the implementation of the material open-ended. He, of course, suggested we do our net training and modeling in Matlab. Personally, I have two problems with his suggestion. First, I am not very comfortable using Matlab. Second, The version of Matlab I have access to is installed on a Celeron 700MHz computer with 128MB of ram, which takes way too long to do the countless mathematical operations needed to train and simulate a net.

Given these concerns, and the fact that I have at my disposal a dual blade 1.4GHz Sun with 2GB if ram, I would like to do all computations on that machine. However, it does not have Matlab (does Matlab even exist for non-Windows?). Therefore, I was hoping to use Perl for my assignments.

I searched CPAN for neural net modules and came across a number of possibilities including AI::NeuralNet::BackProp, AI::NeuralNet::Simple, AI::NNFlex, AI::Perceptron, and AI::jNeural::arch::neuron. Has anyone had any experience with these modules? Any recommendations on which one to use? Any other suggestions are also welcome.

Thanks in advance.

Replies are listed 'Best First'.
Re: Neural Nets
by g0n (Priest) on Apr 07, 2005 at 14:22 UTC
    .oO(I wonder if I'm too partisan to answer this question)

    I agree with cazz about the dangers of not using the tool specified. But if you want to use perl:

    I really struggled using AI::jNeural & AI::NeuralNet::Backprop, which is why I ended up writing AI::NNFlex. AI::Perceptron only supports simple Hebbian learning as far as I know, so you wouldn't be able to simulate non linearly separable problems with that package.

    I'd suggest using either AI::NNFlex, AI::NNEasy or AI::NeuralNet::Simple.

    AI::NeuralNet::Simple and AI::NNEasy both use inline C for speed. AI::NNFlex is pure perl, so it uses various mathematical neural net tricks to speed things up (momentum learning, fahlman constant, non linear error functions etc).

    Which to use really comes down to your requirements - you'll get more granularity of control from AI::NNFlex, but you might find AI::NeuralNet::Simple or AI::NNEasy a bit easier to use.

    g0n, backpropagated monk
Re: Neural Nets
by cazz (Pilgrim) on Apr 07, 2005 at 14:15 UTC

      I know that this isn't anything to do with Neural Nets, but on the same topic of using the tool the professor suggests.

      In my fourth year (of 6 :-}), in a "C/C++" course (I use the term extremely loosely since the professor was completely out to lunch), we were told we had a choice of tools. We could use Borland C++ for DOS, or we could use GCC on HP to develop our software. What a joke - the project included talking to a proprietary device (D/A, A/D converter) on an I/O port. How the professor envisioned using an HP workstation to talk to this proprietary device is beyond me. And the project involved graphing the input to the screen (using Borland's APIs for graphics) - which is unlikely to work on HP (learning X at the same time as dealing with this professor was not really an option).

      Eventually, I told the professor how full of it he was, to his face, he gave me the highest mark allowed (9 in the stanine system), and told me not to show up again.

      Short version: use what the professor tells you - nothing else is likely to work.

      PS - I took a software project course in my last semester where the professor didn't even suggest a language. We used C++, most everyone else used Java. But the professor did not have any bias in languages. So it really didn't matter. (I got my only other 9 in my life in this course.) But when a professor "suggests" something, usually it's more of a "command" in the guise of being open-minded. Use Matlab. :-)

      However, I failed due to 90% of the questions on the midterm were not about neural networks, but how to use the tool that she had the rest of the class use.
      While that may be a good reason to use MatLab, that's a sign of a bad teacher.

      I'm assuming the class wasn't about MatLab, but about Neural Nets! The tools may go in and out of fashion, but the ideas should last much longer.

      Quantum Mechanics: The dreams stuff is made of

Re: Neural Nets
by Jaap (Curate) on Apr 07, 2005 at 14:19 UTC
      What do genetic algorithms have to do with neural nets?
        I wondered about that, so I went and looked it up. Genetic algorithms have been used to derive weight sets for a fully recurrent single layer net to handle the cart and pole problem, a textbook example of NN in control systems. Its an intriguing idea, but a lot more work to implement than a simple backprop net.
        g0n, backpropagated monk
Re: Neural Nets
by Roy Johnson (Monsignor) on Apr 07, 2005 at 20:56 UTC
    PDL touts itself as a Perl extension analogue of Matlab. I haven't used it, but suspect it's worth a look.

    Caution: Contents may have been coded under pressure.
Re: Neural Nets
by Zero_Flop (Pilgrim) on Apr 08, 2005 at 04:22 UTC
    I would use Matlab:

    1) It's designed and optimized for this type of work which may allow it to run faster on slower HW.
    2) The language itself is really easy and if you can do perl you can probably pick it up very quickly.
    3) (If you have the plugin)It has a graphical system for generating NN (ala Labview type interface), which makes generating them trivial and can enhance your understanding.
    4) If you can not use the graphical interface you can still program it in MATLab then run it on your other system using Octave (
    5) As the others have mentioned, you'll be on the same page as the other students in the class.

    One option is to take a simple example like a Perceptron and try all your options. That will allow you to see how difficult each option is.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://445659]
Approved by kutsu
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2018-02-25 14:00 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (312 votes). Check out past polls.