why i am having 'Training data for an autoencoder must either be a matrix, or a cell array of equal size images.' error though my images have the same size?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
my feature vector file is csvlistdnewtarget.mat and it is a 1x83 feature vector of 83 images, all of the 83 images have the same size which is 160x160, this feature vector has the coffiecents of every image after applying wavelet with sym8 filter and then normalizing it. then i have a target matrix which is 5x83
now when i run the code i have this error:
Error using Autoencoder>iConvertToDouble (line 863)
Training data for an autoencoder must either be a matrix, or a cell array of equal size images.
Error in Autoencoder.train (line 489)
[X,visualizationDimensions, trainedOnImages] = iConvertToDouble(X);
Error in trainAutoencoder (line 105)
autoenc = Autoencoder.train(X, autonet, paramsStruct.UseGPU);
Error in cataractd (line 11)
autoenc1 = trainAutoencoder(x,hiddenSize1, ...
>>
here is the code:
function [x,t] = cataractdataset
datastruct_x = load('csvlistdnewtarget.mat');
x = datastruct_x;
datastruct_t = load('targetnew.mat');
t = datastruct_t;
end
%%%%%%in another file%%
[x,t] = cataractdataset;
rng('default')
hiddenSize1 = 100;
autoenc1 = trainAutoencoder(x,hiddenSize1, ...
'MaxEpochs',400, ...
'L2WeightRegularization',0.004, ...
'SparsityRegularization',4, ...
'SparsityProportion',0.15, ...
'ScaleData', false);
view(autoenc1)
figure()
plotWeights(autoenc1);
feat1 = encode(autoenc1,x);
hiddenSize2 = 50;
autoenc2 = trainAutoencoder(feat1,hiddenSize2, ...
'MaxEpochs',100, ...
'L2WeightRegularization',0.002, ...
'SparsityRegularization',4, ...
'SparsityProportion',0.1, ...
'ScaleData', false);
view(autoenc2)
feat2 = encode(autoenc2,feat1);
softnet = trainSoftmaxLayer(feat2,t,'MaxEpochs',400);
view(softnet)
deepnet = stack(autoenc1,autoenc2,softnet);
view(deepnet)
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Pattern Recognition and Classification dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!