class torchelie.datasets.RandomPairsDataset(dataset1, dataset2)

PairedDataset deterministically constructs all possible pairs of items from both datasets. This may cause some problems while sampling if permutation or weight array must be constructed as they would be of size len(dataset1) * len(dataset2) and may not fit in memory.

RandomPairsDataset presents itself as dataset of 10000 elements, and accessing the ith item returns a random pair, effectively ignoring i.

  • dataset1 (Dataset) – a dataset

  • dataset2 (Dataset) – another dataset