DataLoader - discuss.pytorch.org
discuss.pytorch.org › t › dataloader-using-subsetNov 18, 2018 · I have a dataset that contains both the training and validation set. I am aware that I can use the SubsetRandomSampler to split the dataset into the training and validation subsets. The dataset however, has an unbalanced class ratio. How can I also use the WeightedRandomSampler together with the SubsetRandomSampler ? Below is what I currently have using only the SubsetRandomSampler. # build ...
New subset every epoch - PyTorch Forums
discuss.pytorch.org › t › new-subset-every-epochJun 11, 2020 · I have a very big dataset, and I would like to use a different random subset for each epoch of 1000 samples. Is there any way I can do it using Dataset and Dataloader? I would like something like torch.utils.data.RandomSampler but without replacement. train_loader = DataLoader( train_dataset, batch_size=32, shuffle=False, num_workers=1, pin_memory=True, drop_last=True, sampler ...