Re: Neural nets
On Monday, July 7, 2003, at 08:02 PM, muppet wrote: in fact, a friend of mine recently wrote XS bindings for a C++ neural net library, and was talking about putting them on CPAN, i'll have to check on that. i bugged him a bit, and now they're up: http://search.cpan.org/author/RMCFARLA/AI-LibNeural-0.02/LibNeural.pm
Re: Neural nets
On Tue, 8 Jul 2003, Toby Corkindale wrote: > My experience has been that perl stops performing adequately once you're > trying to do math operations over very large quantities of data. > I'm comparing this to C or C++. > > memory usage per-node is much higher, and the time taken to run the math over > the node is quite a bit longer. (this vagueness is qualified a bit below) It's not just "higher". It's a farce. It's partly to do with the fact that it's slow to build and use compact data representations. I have once implemented a cryptographic system with nearly usable performance in pure Perl using substr() a lot and representing everything as a string. > Well, no, actually. There's a significant difference in runtime between the > same program written in Perl or C. Not really distinguishable to the naked eye > until you start scaling up, though. It really depends what you're doing. For some jobs, I've actually started writing them in XS rather than in C, because then I get access to all these nice primitives for doing various sorts of object management, and this even if I don't have any pure Perl elements of my code. S. -- Shevekhttp://www.anarres.org/ I am the Borg. http://www.gothnicity.org/
Re: Neural nets
On Mon, Jul 07, 2003 at 03:19:46PM +0100, Andy Wardley wrote: > Toby Corkindale wrote: > > I'm not convinced Perl is the best language to implement such things. > > Why not? Performance concerns or something else? My experience has been that perl stops performing adequately once you're trying to do math operations over very large quantities of data. I'm comparing this to C or C++. memory usage per-node is much higher, and the time taken to run the math over the node is quite a bit longer. (this vagueness is qualified a bit below) One could write the main bits in C anyway and get to it from Perl via XS, though. But I'd probably just stick to C or C++ all the way in that case. > That's a serious question by the way, not just me being provocative. > > A cow-orker of mine has just implemented a gesture (as in pen stroke, > not "up yours matey" or "swivel on this") recognition net in Ruby and > it seems to be doing the job most admirably. Quick to implement, > fast enough to run. > > Now I realise Perl isn't Ruby, but they're close enough to be compared > side-by-side against say, C, C++ or Java. Well, no, actually. There's a significant difference in runtime between the same program written in Perl or C. Not really distinguishable to the naked eye until you start scaling up, though. if you don't need to run huge neural nets, or many recognitions per second, then you're probably fine to go for Perl/Ruby/java/etc. Or if someone else has already written an xs interface to a C NN library, then bonus! :) -Toby -- Turning and turning in the widening gyre The falcon cannot hear the falconer; Things fall apart, the centre cannot hold; Mere anarchy is loosed upon the world.
Re: Neural nets
On Monday, July 7, 2003, at 02:57 PM, Luis Campos de Carvalho wrote: Andy Wardley wrote: Toby Corkindale wrote: I'm not convinced Perl is the best language to implement such things. Why not? Performance concerns or something else? That's a serious question by the way, not just me being provocative. I think that Perl is not that good on number crunshing. Maybe you should look at fortran (old and good!) or some number-crunshing-specialist tool. on the other hand, perl is excellent for use as glue between number crunching tools written in compiled languages. you do all the heavy lifting in C or fortran, then recombine your heavy lifting in many different ways with application logic in perl. especially good if you need to dump the results of your number crunching into a database (DBI is much easier than most C interfaces) or get the input data from a text file (perl is da bomb for string handling). in fact, a friend of mine recently wrote XS bindings for a C++ neural net library, and was talking about putting them on CPAN, i'll have to check on that.
Re: Neural nets
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * Luis Campos de Carvalho [2003-07-07 14:59]: > Andy Wardley wrote: > >Toby Corkindale wrote: > > > >>I'm not convinced Perl is the best language to implement such things. > > > >Why not? Performance concerns or something else? > > > >That's a serious question by the way, not just me being provocative. > > I think that Perl is not that good on number crunshing. > Maybe you should look at fortran (old and good!) or some > number-crunshing-specialist tool. You mean like PDL (pdl.perl.org)? (darren) - -- Reisner's Rule of Conceptual Inertia: If you think big enough, you'll never have to do it. -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/CcWHzsinjrVhZaoRAk42AJsFZke2Nql8V9iPRC4nnZ9J0eHrawCeOmZN W1ZLRYrp0z0F1x30DSRPp7Q= =QBGD -END PGP SIGNATURE-
Re: Neural nets
Andy Wardley wrote: Toby Corkindale wrote: I'm not convinced Perl is the best language to implement such things. Why not? Performance concerns or something else? That's a serious question by the way, not just me being provocative. I think that Perl is not that good on number crunshing. Maybe you should look at fortran (old and good!) or some number-crunshing-specialist tool. A cow-orker of mine has just implemented a gesture (as in pen stroke, not "up yours matey" or "swivel on this") recognition net in Ruby and it seems to be doing the job most admirably. Quick to implement, fast enough to run. Now I realise Perl isn't Ruby, but they're close enough to be compared side-by-side against say, C, C++ or Java. That's not true, IMHO. Perl is a great for prototype building (it is fast) and reacts well for many kinds of serious applications. But I don't think that it is recommended as a number-crunshing lang. This is quite interesting to me. Good luck, and post your conclusions here so we can learn from them too! -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Luis Campos de Carvalho Computer Scientist, Unix Sys Admin & Certified Oracle DBA http://br.geocities.com/monsieur_champs/ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Re: Neural nets
Toby Corkindale wrote: > I'm not convinced Perl is the best language to implement such things. Why not? Performance concerns or something else? That's a serious question by the way, not just me being provocative. A cow-orker of mine has just implemented a gesture (as in pen stroke, not "up yours matey" or "swivel on this") recognition net in Ruby and it seems to be doing the job most admirably. Quick to implement, fast enough to run. Now I realise Perl isn't Ruby, but they're close enough to be compared side-by-side against say, C, C++ or Java. A
Re: Neural nets
On Sat, Jul 05, 2003 at 03:33:31PM +0100, Adrian McMenamin wrote: > I see various modules at CPAN and I wonder if anyone has any experience using > them and would like to comment? Neural nets in general, yes; Perl versions, no. I'm not convinced Perl is the best language to implement such things. tjc -- Turning and turning in the widening gyre The falcon cannot hear the falconer; Things fall apart, the centre cannot hold; Mere anarchy is loosed upon the world.