Hey team,
as a PyTorch novice, I’m deeply impressed by how clearly standardized and separated all the different elements of a deep learning pipeline are (e.g. dataset, transforms, data loader). However, I don’t quite understand why the transforms are specified when creating a dataset opposed to giving them as a parameter to the data loader that follows.
Right now I have to create a transformation pipeline before instantiating the dataset itself. Looking at my notebook this seems a little like doing things in reverse. Wouldn’t it feel more natural to first specify the dataset and then follow with the transformations I want to do on them?
This would also allow an easier workflow with images. dataset[i] would return the i-th PIL image, which is rendered as an image per default in Jupyter opposed to returning a torch tensor which doesn’t do much for me until the training starts.
Specifying the transforms to the data loader would allow a cleaner workflow regarding training/validation splits and different types of transformations I want to run on each. Right now I have to create the same dataset twice but with different transformations, create 2 subset-samplers that I provide to the 2 data loaders. If transforms were given to the loader there would only be 1 dataset object that is used to create 2 subsets, which each gets their own train/validation transformations.
Does this make sense?
Although my post sounds like I’m suggesting a change, I’m surely just overlooking something in plain sight. I would like to know what that it.
Thanks,
pietz