trained stacked auto encoders

3 次查看(过去 30 天)
Helo.. iam working on pothole dataset classification by using trained stacked auto encoders concept. Below i have attached the matlab code... in that code they have loaded the dataset using digitTrainCellArrayData but i want to load the pothole dataset .Could any one please help me with the code that how to load the dataset folder.
Thans in advance:)
% Load the training data into memory
[xTrainImages,tTrain] = digitTrainCellArrayData;
% Display some of the training images
clf
for i = 1:20
subplot(4,5,i);
imshow(xTrainImages{i});
end
rng('default')
hiddenSize1 = 100;
autoenc1 = trainAutoencoder(xTrainImages,hiddenSize1, ...
'MaxEpochs',400, ...
'L2WeightRegularization',0.004, ...
'SparsityRegularization',4, ...
'SparsityProportion',0.15, ...
'ScaleData', false);
view(autoenc1)
figure()
plotWeights(autoenc1);
feat1 = encode(autoenc1,xTrainImages);
hiddenSize2 = 50;
autoenc2 = trainAutoencoder(feat1,hiddenSize2, ...
'MaxEpochs',100, ...
'L2WeightRegularization',0.002, ...
'SparsityRegularization',4, ...
'SparsityProportion',0.1, ...
'ScaleData', false);
view(autoenc2)

回答(1 个)

Divya Gaddipati
Divya Gaddipati 2020-6-22
One way is to use imageDatastore.
datasetPath = fullfile('/path/to/dataset');
imds = imageDatastore(datasetPath, ...
'IncludeSubfolders',true,'LabelSource','foldernames');
Refer to the Load and Explore Image Data section in the following example:
For more information on imageDatastore, you can refer to the below link

产品


版本

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by