ajbrock / BigGAN-PyTorch

The author's officially unofficial PyTorch BigGAN implementation.
MIT License
2.86k stars 476 forks source link

Question regarding the MultiEpochSampler #44

Open zxhuang97 opened 5 years ago

zxhuang97 commented 5 years ago

I've been reading the codebase, and find the MultiEpochSampler looks weird to me. Don't know if I understand it correctly, but it seems to me that in function utils.get_data_loaders train_set is a vanilla data loader that read through all the data once, namely one epoch of data. sampler is a MultiEpochSampler whose length is len(train_set) num_epoch. While in training, it's a nested loop that iterates through sampler for num_epoch times. In total, the model is trained on num_epoch^2 len(train_set) images, and the "real" epoch is actually num_epoch^2.

I'm wondering if it's on purpose or a bug. Thank you very much.

JanineCHEN commented 4 years ago

Having the same doubles here