While using Pytorch's DataLoader utility, in sampler what is the purpose of RandomIdentitySampler? And in RandomIdentitySampler there is an argument instances. Does instances depends upon number of workers? If there is are 4 workers then should there be 4 instances as well?
Following is the chunk of code:
c_dataloaders = DataLoader(Preprocessor(cluster_dataset.train_set,
root=cluster_dataset.images_dir,
transform=train_transformer),
batch_size=args.batch_size_stage2,
num_workers=args.workers,
sampler=RandomIdentitySampler(cluster_dataset.train_set,
args.batch_size_stage2,
args.instances)