BatchAugSampler¶
- class mmocr.datasets.samplers.BatchAugSampler(dataset, shuffle=True, num_repeats=3, seed=None)[源代码]¶
Sampler that repeats the same data elements for num_repeats times. The batch size should be divisible by num_repeats.
It ensures that different each augmented version of a sample will be visible to a different process (GPU). Heavily based on torch.utils.data.DistributedSampler.
This sampler was modified from https://github.com/facebookresearch/deit/blob/0c4b8f60/samplers.py Used in Copyright (c) 2015-present, Facebook, Inc.
- 参数
dataset (Sized) – The dataset.
shuffle (bool) – Whether shuffle the dataset or not. Defaults to True.
num_repeats (int) – The repeat times of every sample. Defaults to 3.
seed (int, optional) – Random seed used to shuffle the sampler if
shuffle=True
. This number should be identical across all processes in the distributed group. Defaults to None.