Giter VIP home page Giter VIP logo

Comments (3)

jmorel avatar jmorel commented on June 28, 2024

I gave it a try and very rapidly got to something for trivial cases like using Pickle or Joblib but was wondering about more complex stuff like pytorch (for reference: https://pytorch.org/tutorials/beginner/saving_loading_models.html)

Pytorch model are often bundled with an optimizer. In order to save them both, the train method should therefore return both. The trouble I have is that the documentation of the Algo class only says that the train method returns a model object, not a tuple. Also in order to use a model returned by load_model, you'd have to write something like model, optimizer = model.

This feels a bit forced and not easy to understand for users. I think it could be simpler to have Algo subclasses that have different signatures for the train / predict methods. In order to accomodate different signatures, these classes would have to have translate methods that transform args from the basic format to a more specific one.

Do you think this added complexity would be acceptable?

from substra-tools.

samlesu avatar samlesu commented on June 28, 2024

I agree, it's not ideal.

I'm not in favour now to add Algo subclasses, I don't think the complexity is worth it and it would require more thinking (create also subclasses for the openers?). We already have multiple subclasses (Composite, Aggregate and Algo) to handle different use cases and I think we should first try to go back to a single class.

from substra-tools.

samlesu avatar samlesu commented on June 28, 2024

Not a priority now. Would be good.

from substra-tools.

Related Issues (13)

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.