Code Monkey home page Code Monkey logo

Comments (6)

josevalim avatar josevalim commented on June 2, 2024 1

Yeah, Axon already has a guide and maybe we can have one in Scholar that starts with a dataset and manipulates it, but for now I don't think it is a Nx specific concern. :) Thanks!

from nx.

josevalim avatar josevalim commented on June 2, 2024

It really depends on what you want. Nx.to_batched/3 is a starting point and Explorer can give you parallel capability. Enum, Stream, and Task.async_stream will encapsulate many conveniences as well (and there is also Flow). I think we need to step back from the answer (DataLoader) and think about the question and which problems we want to solve. Several examples will help. Then if there is a shared need, a new abstraction may arise.

from nx.

krstopro avatar krstopro commented on June 2, 2024

I think I saw the same patterns being used several times. Basically, data shuffling using Enum.shuffle/1, batching with Nx.to_batched/3 or Stream.chunk_every/4, augmentation with Stream.map/2, etc. Something like data_stream in this notebook.

Feel free to close the issue if you feel like it's impossible to wrap this in a module.

from nx.

josevalim avatar josevalim commented on June 2, 2024

I think the biggest question is: should we wrap it? Why not use functions that compose neatly? Isn't that better than a large interface with several options that hide how they relate to each other?

from nx.

krstopro avatar krstopro commented on June 2, 2024

I am not sure myself, which is another reason I asked. There aren't that many options that a loader should support: batch size, whether to shuffle the dataset, number of workers, whether to drop the incomplete batch, collate function, etc. Perhaps releasing a notebook with a conventional way to do it might be a better idea (assuming there isn't one already that I missed).

from nx.

krstopro avatar krstopro commented on June 2, 2024

Agreed.

from nx.

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.