I have the following image datastore:
myDataset = imageDatastore('C:\MyData',... 'IncludeSubfolders',true,... 'FileExtensions','.png',... 'LabelSource','foldernames');[imdsTrain, imdsVal, imdsTest] = splitEachLabel(myDataset, 0.6, 0.2, 'randomized');
Which I then prepare to input into some pre-trained networks:
augimdsTrain = augmentedImageDatastore([227 227 3],imdsTrain,... 'ColorPreprocessing', 'gray2rgb',... 'DataAugmentation', augmenter);augimdsVal = augmentedImageDatastore([227 227 3],imdsVal, ... 'ColorPreprocessing', 'gray2rgb');augimdsTest = augmentedImageDatastore([227 227 3],imdsTest,... 'ColorPreprocessing', 'gray2rgb');
What is the correct syntax for using augimdsVal as 'ValidationData'in trainingOptions? Do I just use the augmented datastore as is (as I've seen in some of the documentation):
options = trainingOptions('sgdm','InitialLearnRate', 0.0001, 'ValidationData', augimdsVal);
Or can I add labels like so:
options = trainingOptions('sgdm','InitialLearnRate', 0.0001, 'ValidationData', {augimdsVal imdsVal.Labels});
Or is there a better way?
Best Answer