libann-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libann-users] Re: libann - some questions


From: John Darrington
Subject: [libann-users] Re: libann - some questions
Date: Tue, 27 Jul 2004 16:46:45 +0800
User-agent: Mutt/1.5.4i

On Fri, Jul 23, 2004 at 10:59:53AM +0200, address@hidden wrote:
     after first tests with libann I have some questions.
     
     For one application I need as output value not a character (i.e.
     classname), I need a vector of floats. Well, I had a look at the sources of
     feature map and output map but I'm not sure where to do changes.
     
     My application is the following: Input vector is material composition of
     steel (vector of floats). As output vector I need a vector of floats which
     contain a set of parameters for a math equation which describes the
     material characteristics.
     
     If you can give me a hint where to look and modifiy your source code if
     necessary or how to use the libann to realize this, that would be nice.
     

You have several options:

1.  The simplest (but least efficient) way is to compose a map to
    translate between the string that ann::Mlp::recall will give you
    and the type that you want. Thus:

    std::map<std::string,myClassType> myMap;

    .... populate myMap

    FeatureMap fm;

    ..... populate fm

    
    ann::Mlp net(inputSize,outputSize,1,0);

    net.train(fm);

    string ans =     net.recall(...);

    /* lookup result in myMap */

    myVectorResult = myMap[ans];

or
2.  Alternatively, if you want to delve into the internals of the
    library, you need to  replace (almost) all occurances of
    std::string with YourType (best to use a typedef) in FeatureMap
    and OutputMap.

    This will have quite a knock-on effect, and you'll find that
    you'll have to change quite a lot of the source.  Also, if you
    want to persist your network, then you'll have to write
    persistence functions for YourType.

or
3.  It's been in the back of my mind to make the FeatureMap a template
    class, so that users can represent the classes with strings,
    integers, vectors of floats or whatever else suits them.  Now that
    this has become a real issue, I'll do this in the next release.


John

     

-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://wwwkeys.pgp.net or any PGP keyserver for public key.


Attachment: pgpg0U_QbVp5F.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]