I'm learning pytorch, and I'm trying to implement a paper about the progressive growing of GANs. The authors train the networks on the given number of images, instead of for a given number of epochs.
My question is: is there a way to do this in pytorch, using default DataLoaders? I'd like to do something like:
loader = Dataloader(..., total=800000)
for batch in iter(loader):
... #do training
And the loader loops itself automatically until 800000 samples are seen.
I think that I'd be a better way, than to calculate the number of times you have to loop through the dataset by yourself