Reputation: 6466
My data, which is images, is stored on the filesystem, and it is fed into my convolutional neural network through the ImageFolder
data loader of PyTorch
. Therefore, the training
, validation
, and test
data is manually splitted into different folders on the filesystem. So, how can I apply k-fold cross validation
when using ImageFolder
?
Upvotes: 2
Views: 3224
Reputation: 114906
You can merge the fixed train/val/test folds you currently have using data.ConcatDataset
into a single Dataset. Then you can use data.Subset
to randomly split the single dataset into different folds over and over.
Upvotes: 1