In the __getitem__ method, the authors call min(self.labels), which could be extremely slow...
Also, it assumes that the label in self.labels is "continuous", which may bring unexpected bugs when changing to another dataset.
I suggest converting self.labels into the corresponding ordinal number to avoid the performance issue and possible bugs.