trained stacked auto encoders

4 ビュー (過去 30 日間)
Srinidhi Gorityala
Srinidhi Gorityala 2020 年 6 月 19 日
回答済み: Divya Gaddipati 2020 年 6 月 22 日
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