Giter Site home page Giter Site logo

Models are not serializable about smile HOT 14 CLOSED

haifengl avatar haifengl commented on April 29, 2024
Models are not serializable

from smile.

Comments (14)

haifengl avatar haifengl commented on April 29, 2024

I use XStream (http://xstream.codehaus.org) for serialization of models. Can you have a try? Thanks!

from smile.

haifengl avatar haifengl commented on April 29, 2024

Previously, all models support Serializable interface. However, I remove them due to several concerns. For example, the exact format is hard to keep stable, class changes can easily make your serialized data unreadable, reading/writing the data in non-Java code is almost impossible. I am still looking for a simple and flexible solution. Currently, XStream seems good enough and your classes don't need implement any interfaces. In the future, I would like to support PMML for some models.

I am very open to this question and would like to listen all kinds of suggestions! Thanks!

from smile.

nopper avatar nopper commented on April 29, 2024

Fair enough. Thanks for the suggestion ;) Really appreciated. I am gonna close the issue.

from smile.

haifengl avatar haifengl commented on April 29, 2024

Can you please reopen this ticket? I would like to listen to different voice. Hope more people will see this ticket. Thanks!

from smile.

haifengl avatar haifengl commented on April 29, 2024

Thanks!

from smile.

kid1412z avatar kid1412z commented on April 29, 2024

Protostuff(https://code.google.com/p/protostuff/) or Hessian(http://hessian.caucho.com/doc/hessian-serialization.html)? I use them to compress the loaded Objects in my LSH of SimHash version. It reduce the memory of old generation of jvm. In my case, the serialized objects of Protostuff are smaller.

from smile.

haifengl avatar haifengl commented on April 29, 2024

Thanks! I will check out them.

from smile.

haifengl avatar haifengl commented on April 29, 2024

Protostuff looks very good. But seems we need create schema for every model. A lof of work.

from smile.

kid1412z avatar kid1412z commented on April 29, 2024

I think schema is used to keep compatible if the model has to be changed.
Otherwise, runtime schema can be used and it doesn't need too much code as shown in the example code.

from smile.

haifengl avatar haifengl commented on April 29, 2024

Sounds great! Will learn more about it. If we choose it, would you like to work together on it? Thanks!

from smile.

kid1412z avatar kid1412z commented on April 29, 2024

Of course :)
2015-03-25 21:52 GMT+08:00 Haifeng Li [email protected]:

Sounds great! Will learn more about it. If we choose it, would you like to
work together on it? Thanks!


Reply to this email directly or view it on GitHub
#20 (comment).

from smile.

haifengl avatar haifengl commented on April 29, 2024

With runtime schema, it seems that the usage of ProtoStuff is similar with XStream. I prefer not to modify the model object for specific serialization library. So it is better for the users to choose whatever they want. If we finally choose some serialization library, I still want to do it in a separate module and leave smile-core unchanged.

from smile.

haifengl avatar haifengl commented on April 29, 2024

A second thought: do we really need backward/forward compatibility? If the model member variables change, it usually means a serious change to the algorithm. It is better to retrain the model rather than importing the old model.

from smile.

haifengl avatar haifengl commented on April 29, 2024

Any comments (or complains) to my second thoughts? Thanks!

from smile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.