scottire / fastpages

Apache License 2.0
21 stars 9 forks source link

But what are PyTorch DataLoaders really? | Scott Condron’s Blog #7

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

But what are PyTorch DataLoaders really? | Scott Condron’s Blog

Creating custom ways (without magic) to order, batch and combine your data with PyTorch DataLoaders.

https://www.scottcondron.com/jupyter/visualisation/audio/2020/12/02/dataloaders-samplers-collate.html

aolle125 commented 3 years ago

Great Post! Thanks for this.

jimypbr commented 3 years ago

Thanks. This was really useful!

kforcodeai commented 3 years ago

Very great post, nicely detailed and paced. Awesome job

Fuzzy-sh commented 2 years ago

Thank you so much for your detailed-oriented explanation. Is that possible to elaborate on WeightedRandomSampler as well ?

scottire commented 2 years ago

If you understand what's written above about Samplers, WeightedRandomSampler won't take much extra effort to understand. You just decide how much you want to weight each sample using a big list. It'll then generate indices based on the list of "weights" you passed in. A good way to explore what it does interactively would be to instantiate it like I did with the Samplers above and iterate through it to see the indices it returns.

Moadab-AI commented 2 years ago

Hi,

Nice artcile, is there a reason you always shuffle the lists in iter ? why not in shuffle in init ? to me it makes more sense to keep shuffling out of iter, no? and the behaviour seems to be the same anyway.