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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for list_dataloaders-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b78fce209c197cadcd29782b21c72dbfd8a74fb87caf956b0e4011ed5abc67b7
MD5 40db3b5601597f3e300c225ba79ab6ae
BLAKE2b-256 713c298814a7b16e9cfbfba26b59f24c889b43aa9c9ac1f0fe5420fbcd377d71

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