Skip to main content

This package contains a pure-python class that wraps a list of dataloaders and allows to iterate over them in a random order.

Project description

List dataloaders

This repository contains an hyper-simple wrapper class that allows to iterate over a list of dataloaders in a transparent way.

Installation

pip install list-dataloaders

or directly from the repository:

pip install git+https://github.com/MorenoLaQuatra/list-dataloaders.git

Usage

from list_dataloaders import ListDataLoaders

list_dataloaders = []
train_dl1 = DataLoader(...)
train_dl2 = DataLoader(...)
train_dl3 = DataLoader(...)
list_dataloaders.append(train_dl1)
list_dataloaders.append(train_dl2)
list_dataloaders.append(train_dl3)

train_dls = ListDataLoaders(list_dataloaders)

for batch in train_dls:
    print(batch)

Options and parameters

The main class ListDataLoaders has the following parameters:

  • dataloaders: the list of dataloaders to iterate over
  • verbose: if True, prints the number of samples in each dataloader (default: False)
  • weight_by_num_samples: if True, the probability of sampling a dataloader is proportional to the number of samples in the dataloader (default: True)

License

This project is licensed under the terms of the MIT license.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

list-dataloaders-1.0.1.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

list_dataloaders-1.0.1-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file list-dataloaders-1.0.1.tar.gz.

File metadata

  • Download URL: list-dataloaders-1.0.1.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for list-dataloaders-1.0.1.tar.gz
Algorithm Hash digest
SHA256 5d19b0dbdc31482aebef0c02cc616bd7e48af759242f3324983b6c7500692941
MD5 b5e4758da7445e0330a5de77acef05cc
BLAKE2b-256 c0a27c1f8bc3014d1357bcfb1e34f2e710848f2d16555b19595921933007e228

See more details on using hashes here.

File details

Details for the file list_dataloaders-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for list_dataloaders-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 178d726f2760698d5d315e9d98109a114bd4aed0a3195d38fa68ff5955daa490
MD5 9ac3669621626d9361914a8e1c8867ab
BLAKE2b-256 91e76886ce7bd543de77d678900335d2ea99e10271dd3cbadb62b3dc438c02a4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page