I'm trying to implement a triplet loss for a large number of class. I've checked out a few of its implementations in PyTorch. However, they are usually used for datasets with a limited number of labels. (Reading the images label into an array and using that to choose the images for the triplets).
Having an array with such a huge number of labels seem very heavy in term of computing cost. Is there a way/existing implementation of a triplet loss for a huge number of classes?