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.
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.