Christian -

I'm sorry nobody has responded sooner to your query, but it's a pretty
tough question, so I'm not terribly surprised. :-)

For anybody else following along, the shogun project Christian refers
to is the Shogun Machine Learning Toolbox:
http://www.shogun-toolbox.org/doc/en/current/index.html. SHOGUN
supports multiple languages: "SHOGUN is implemented in C++ and
interfaces to Matlab(tm), R, Octave and Python." And Lua, btw.

Having scanned the docs briefly (especially the developer tutorial:
http://www.shogun-toolbox.org/doc/en/current/developer_tutorial.html),
I think that the best route would be to create Perl wrappers for the
Shogun classes. The Wx folks have extensive experience doing this. You
should start by looking at http://p3rl.org/ExtUtils::XSpp, and then
possibly hopping on the Wx and/or Padre mailing lists or IRC channels.

Then, you would want some way to interface PDL data with SHOGUN
SGMatrix objects. There are a few options here. (1) Create a function
that copies from one to the other and back. (2) Create a handful of
PDL wrappers of SGMatrix classes, which requires a little bit of PDL
(black?) magic, but not much. I could probably point you to useful
code in this respect. (3) Create a set of C++ classes that know how to
wrap PDL data in a form derived from SGMatrix. The main drawback here
is that you would then have to properly handle slices, which is why I
would prefer the second idea to this third one.

A bystander might ask: why not just wrap SHOGUN's methods into PDL
routines? Well, SHOGUN uses C++'s object orientation pretty
extensively, so trying to wrap the SHOGUN methods into PDL methods
would be very difficult, and very much exploratory. There's a lot of
meta-information that you'd have to slog around, and keeping track of
it all---while doable using the header hash, maybe---would likely be a
suboptimal solution.

So, I propose you aim to create a Perl wrapper for project. Talk to
the Wx people and get their advice. Once that's working, you can
quickly hack together a means to copy data between PDL and SHOGUN, and
then aim for a PDL-side wrapper of the SHOGUN data types.

David

On Fri, Oct 5, 2012 at 4:41 AM, Christian Montanari
<[email protected]> wrote:
> Hi,
> I am attempting to tie the "shogun" package to PDL.
> "shogun" has already many classes used in PDL, mainly of course, data
> formats, but also IO classes, so those packages are a tat similare.
> however PDL is for data parsing, while "shogun" is more for developing
> algorithms using data.
>
> so far I managed a rough interface (it links!), but I am still not
> very confident in the inner guts of the wrappers.
>
> I am looking for advices or support from a PDL experts but
> particularely nice source code examples for specific usage.
>
> I found somewhat the pdl-api is missing a few goodies and I would not
> mind any expert in the art of PDL show some example of use of...:
>
> - affine functions used for parsing PDL structures?
>
> - pdl-api for inline operations
>
> - strings , storage or RV referenced perl-objects in pdl ?
>
> - pdl-api for slices ?
>
> - best use of the "threading"
>
> - relations beetween pdl data, datasv , sv, hdrsv.
>
> - sparse format (sparse vector, matrix, n-gram...) (ie:  map/hash (or tie) of 
> arrays index/ranges
> to pdl.data )
>
> - sub - pdl organisation ?
>
> I have somewhat partial answers to a few of those, but might not be
> the best and the pretiest!
>
> also I have two ways to embed te packages: do I wrap PDL into "shogun" or
> vice versa? (the first I am using a "swig - perl" wrapper, but for the
> other I suppose one has to use the wonderfull .PL mechanisme!)
>
> please, if you are interrested to develop a wrapper likewise, I am
> happy to send you my 'git' project, or please share your examples....
>
> Thanks for your time.
>
> --
> -------------------------------------------------------
> Dr. Christian Montanari, Consulting Engineer, Hillebrand Consulting Engineers 
> GmbH
> skype: cp.montanari
>
>
>
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl



-- 
 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to