How to use RandomSampler - PyTorch Forums
discuss.pytorch.org › t › how-to-use-randomsamplerFeb 01, 2020 · Ubuntu 18.04 or Mac OS Catalina, Python 3.7, PyTorch 1.4.0 I try to sample from a dataset using predefined indices, SubsetRandomSampler works as expected, RandomSampler does not work as expected, I check the source code, and it seems RandomSampler is just using the length of the data_source argument and the samples has nothing to do with data_source, can anyone help me understand what is the ...
DataLoader - using SubsetRandomSampler and ...
discuss.pytorch.org › t › dataloader-usingNov 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 ...