-
Hi all, I wonder if anyone has given any thought about repeated augmentation and its effect on the training. From a look at the code, if using repeated augmentation (say 3), then the number of samples we train per epoch is extended 3 times. In other words, each epoch will become 3 times longer. As a result, when setting Can anyone comment on whether the benefit of repeated augmentation is because of itself, or simply because it is training n times longer? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @vbvg2008 Benefit of repeated augmentation is from itself. Repeated augmentation does not extend training epoch. In this code, the number of selected samples for each gpu is For better understanding, see below code with comments. class RepeatAugSampler(Sampler):
def __init__(self, ...):
...
selected_ratio = dist.get_worl_size() # selected_ratio = number of gpu
self.num_selected_samples = len(self.datasets) / selected_ratio # num_selected_samples = len(dataset) / (number of gpu)
def __iter__(self):
...
return iter(indices[:self.num_selected_samples]) # whatever indices is, it is sliced as long as num_selected_samples I want this answer can help you. Thank you. hankyul |
Beta Was this translation helpful? Give feedback.
Hi @vbvg2008
Benefit of repeated augmentation is from itself. Repeated augmentation does not extend training epoch.
RepeatAugSampler
only select1/aug_repeat
samples from whole dataset and repeat each sample foraug_repeat
times so that each gpu could train model on same samples.In this code, the number of selected samples for each gpu is
len(dataset)/num_gpu
, which means that the number of samples does not change at all.For better understanding, see below code with comments.