Giter VIP home page Giter VIP logo

Comments (7)

monatis avatar monatis commented on May 18, 2024 1

I guess this one was fixed and may be closed. @generall

from quaterion.

joein avatar joein commented on May 18, 2024

As another possibility, we can return dataloader to the state when it is usable (after setup_dataloader and before fit)

But the idea to skip unwrapping seems more functional, as we do not need to calculate embeddings again then

from quaterion.

monatis avatar monatis commented on May 18, 2024

Good point. We can name the keyword arg something like keep_cache and this would be self-explanatory.

I'm not sure but we may also consider removing it from Quaterion.fit completely from because we already call it in save_servable.

But again, optional skipping seems to be generalizable to more use cases

from quaterion.

generall avatar generall commented on May 18, 2024

But the idea to skip unwrapping seems more functional, as we do not need to calculate embeddings again then

the problem is that if user have 3rd left-off dataset, which was not used during the fit - it will be incompatible with cached data loader. From my point of view I would prefer to keep cache wrappings internally and unwrap dataloaders before as well as model before the return

from quaterion.

monatis avatar monatis commented on May 18, 2024

if user have 3rd left-off dataset,

then they can prefer to unwrap it --it'll be optional anyway.

keep cache wrappings internally and unwrap dataloaders

I'm not sure that I got this correctly.

from quaterion.

monatis avatar monatis commented on May 18, 2024

My proposal is as follows:

  1. Quaterion.fit(..., keep_cache: bool = True).
  2. Then in that method:
if not keep_cache:
    trainable_model.unwrap_cache(train_dataloader, val_dataloader) # it should unwrap data loaders and model synchronously
  1. Rename TrainableModel.cache to TrainableModel.cache_dataloader, and except a single data loader instead of two, so that user can cache their 3rd (or n-th) data loader when they need to.
  2. Call TrainableModel.setup_dataloader inside TrainableModel.cache_dataloader
  3. Document the whole cycle of training / testing and how caching is functioning.

from quaterion.

generall avatar generall commented on May 18, 2024

Another possible side effect - double wrapping of encoders during the recovery from checkpoint. Possible solution: check if encoder is already a subclass of cache

from quaterion.

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.