peal.data.dataloaders.WeightedDataloaderList

class peal.data.dataloaders.WeightedDataloaderList[source]

Bases: object

A list of DataLoader objects with associated sampling weights.

Parameters:
  • dataloaders (list of DataLoader) – Members; each is asserted to be a torch.utils.data.DataLoader.

  • weights (torch.Tensor, optional) – Initial weights. Defaults to uniform 1 / len(dataloaders).

Methods

append

Add a dataloader, halving the existing weights and giving it weight 0.5.

__init__(dataloaders, weights=None)[source]

Validate the members and set uniform weights if none are given.

append(dataloader)[source]

Add a dataloader, halving the existing weights and giving it weight 0.5.