forum.alglib.net

ALGLIB forum
It is currently Sun Dec 22, 2024 1:38 am

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Serialization in 3.x
PostPosted: Tue Nov 23, 2010 10:18 am 
Offline

Joined: Thu Sep 23, 2010 11:21 pm
Posts: 5
I just began porting code over to Alglib 3.1 and can't find the serialization interface for logit . Has this code been written? If so, what are the new routines called?

If not is it relatively trivial to lift over the old 2.x serialization code and modify it for use with 3.1?


Top
 Profile  
 
 Post subject: Re: Serialization in 3.x
PostPosted: Tue Nov 23, 2010 2:44 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
ALGLIB 3.x does not include serialization code yet. It wasn't ported from 2.x because of plans to introduce new, better serialization facilities (both functionality and implementation will change) in the beginning of 2011. So I had to choose between backward incompatibility when porting from 2.6 to 3.0 and incompatibility when porting from 3.x to 3.(x+1).

Luckily, in most cases you can store ALGLIB object without serialization interface. As for logit, you can use mnlunpack() function to access its coefficients.


Top
 Profile  
 
 Post subject: Re: Serialization in 3.x
PostPosted: Tue Nov 23, 2010 2:48 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
Quote:
If not is it relatively trivial to lift over the old 2.x serialization code and modify it for use with 3.1?

Yes, you can port it with only slight changes. There are two problems:
* internal representation of arrays in 3.x is different from that of 2.x, so you have to modify code which reads/writes object fields
* in 3.x almost all fields are hidden, private
But both these problems are solvable. As for data analysis package, nothing was changed in the internals, so you can leave "pack-unpack" logic unchanged.


Top
 Profile  
 
 Post subject: Re: Serialization in 3.x
PostPosted: Fri Jul 08, 2016 8:40 pm 
Offline

Joined: Mon Dec 09, 2013 12:38 pm
Posts: 7
Hello, Sergey!

I am sorry for my stupid question but I did not find out clear explanation of one issue...
I trained a Neural networks ensemble with function alglib::mlpetraines(). Next I made serialization of the ensemble. Do I need to call the function alglib::mlpecreatec1() (that I called before alglib::mlpetraines()) before calling function alglib::mlpeunserialize() or not ?

Code:
alglib::mlpecreate1(nin, nhid, nout, ensemblesize, ensemble_A);
alglib::mlpetraines(ensemble_A, XY_set, npoints, decay, restarts, info, rep);
alglib::mlpeserialize( ensemble_A, string_mem );
...
...
...
version 1:
alglib::mlpecreate1(nin, nhid, nout, ensemblesize, ensemble_B);
alglib::mlpeunserialize( string_mem, ensemble_B);
alglib::mlpeprocess(ensemble_B, x_Vector, y_Out);

version 2:
alglib::mlpeunserialize( string_mem, ensemble_B);
alglib::mlpeprocess(ensemble_B, x_Vector, y_Out);

Which version of the code is right, 1 or 2 ?
Thank you in advance.


Top
 Profile  
 
 Post subject: Re: Serialization in 3.x
PostPosted: Mon Jul 11, 2016 8:39 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
version 2 is correct. Version 1 will work too, but mlpeunserialize() will overwrite target network anyway, so 2 is better.


Top
 Profile  
 
 Post subject: Re: Serialization in 3.x
PostPosted: Mon Jul 11, 2016 8:02 pm 
Offline

Joined: Mon Dec 09, 2013 12:38 pm
Posts: 7
Thank you very much for your reply!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group