Aggregator#
Utility class for aggregating multiple dataloaders into a single iterable.
- class _Aggregator(dataloaders, batching_mode)[source]#
Bases:
objectAggregate multiple dataloaders into a unified iterable object.
The aggregator combines batches produced by multiple dataloaders according to the selected batching strategy. It is primarily used to coordinate the iteration of multiple training conditions within a single training loop.
Initialization of the
_Aggregatorclass.- Parameters:
dataloaders (dict[str, DataLoader]) – The mapping between condition names and their corresponding dataloaders.
batching_mode (str) – The strategy used to aggregate batches across dataloaders. Available options are
"common_batch_size"for uniform batch sizes across conditions,"proportional"for batch sizes proportional to dataset sizes, and"separate_conditions"for iterating through each condition separately.
- Raises:
NotImplementedError – If the selected batching mode is not yet implemented.