I have defined my custom torch Dataset with a method normalize_features(self), which just normalizes the features. Later in the code, I use torch.utils.data.random_split to split my data into train and test. However, this will create a Subset class types.
Now, when I call train_data.normalize_features(), it will throw an error, since the Subset does not inherit from my poor custom Dataset class. On the other hand, if I call train_data.dataset.normalize_features(), which will access the original dataset, now I will get the whole dataset normalized, despite wanting just the train_data normalized.
Any suggestions how to make the Subset inherit my method? Or any neat hacks to go around this?