avalanche.benchmarks.utils.data_loader.GroupBalancedInfiniteDataLoader
- class avalanche.benchmarks.utils.data_loader.GroupBalancedInfiniteDataLoader(datasets: ~typing.Sequence[~avalanche.benchmarks.utils.data.AvalancheDataset], collate_mbatches=<function classification_collate_mbatches_fn>, distributed_sampling: bool = True, **kwargs)[source]
Data loader that balances data from multiple datasets emitting an infinite stream.
- __init__(datasets: ~typing.Sequence[~avalanche.benchmarks.utils.data.AvalancheDataset], collate_mbatches=<function classification_collate_mbatches_fn>, distributed_sampling: bool = True, **kwargs)[source]
Data loader that balances data from multiple datasets emitting an infinite stream. Mini-batches emitted by this dataloader are created by collating together mini-batches from each group. It may be used to balance data among classes, experiences, tasks, and so on. :param datasets: an instance of AvalancheDataset. :param collate_mbatches: function that given a sequence of mini-batches
(one for each task) combines them into a single mini-batch. Used to combine the mini-batches obtained separately from each task.
- Parameters:
kwargs – data loader arguments used to instantiate the loader for each group separately. See pytorch
DataLoader
.
Methods
__init__
(datasets[, collate_mbatches, ...])Data loader that balances data from multiple datasets emitting an infinite stream. Mini-batches emitted by this dataloader are created by collating together mini-batches from each group. It may be used to balance data among classes, experiences, tasks, and so on. :param datasets: an instance of AvalancheDataset. :param collate_mbatches: function that given a sequence of mini-batches (one for each task) combines them into a single mini-batch. Used to combine the mini-batches obtained separately from each task. :param kwargs: data loader arguments used to instantiate the loader for each group separately. See pytorch
DataLoader
.