Hello,
From this forum, I learned how to use the random weighted sampler to pull more of the minority class than the majority class.  How would I calculate the batches correctly to make sure all of my images are used?
Here is my code for the weighted sampler:
batch_size = 10
class_sample_count = [46699, 17739] 
weights = 1 / torch.Tensor(class_sample_count)
sample_weights = weights[target]
weights = weights.double()
sampler = torch.utils.data.sampler.WeightedRandomSampler(
    weights=sample_weights,
    num_samples=len(sample_weights),
    replacement=True)
#trainloader = torch.utils.data.DataLoader(trainDataset, batch_size = batch_size, sampler = sampler)

train_loader = DataLoader(roof, batch_size=10, sampler = sampler)

So with a batch size of 10, I would run 6444 batches per epoch to get all of the images through.  How would I do it with a random weighted sampler?