increase number of hidden layers
6 次查看(过去 30 天)
显示 更早的评论
This is my matlab code
layers = [
imageInputLayer([256 256 3])
convolution2dLayer(4,13,'Padding','same')
batchNormalizationLayer
reluLayer
maxPooling2dLayer(11,'Stride',11)
convolution2dLayer(7,28,'Padding','same')
batchNormalizationLayer
reluLayer
maxPooling2dLayer(11,'Stride',11)
convolution2dLayer(5,34,'Padding','same')
batchNormalizationLayer
reluLayer
fullyConnectedLayer(38)
softmaxLayer
classificationLayer];
options = trainingOptions('sgdm', ...
'InitialLearnRate',0.06, ...
'MaxEpochs',10, ...
'Shuffle','every-epoch', ...
'ValidationData',imdsValidation, ...
'ValidationFrequency',30, ...
'Verbose',false, ...
'Plots','training-progress');
net = trainNetwork(imdsTrain,layers,options);
YPred = classify(net,imdsValidation);
YValidation = imdsValidation.Labels;
accuracy = sum(YPred == YValidation)/numel(YValidation)
I want to increase the no of hidden layers. please somebody help.
0 个评论
回答(1 个)
Srivardhan Gadila
2020-5-3
You can refer to List of Deep Learning Layers and add layers like convolution2dLayer, fullyConnectedLayer to your above layer array.
You can also refer to the following resources Deep Learning Tips and Tricks, Specify Layers of Convolutional Neural Network & Create Simple Deep Learning Network for Classification
layers = [
imageInputLayer([256 256 3])
convolution2dLayer(4,13,'Padding','same')
batchNormalizationLayer
reluLayer
maxPooling2dLayer(11,'Stride',11)
convolution2dLayer(7,28,'Padding','same')
batchNormalizationLayer
reluLayer
maxPooling2dLayer(11,'Stride',11)
convolution2dLayer(5,34,'Padding','same')
batchNormalizationLayer
reluLayer
fullyConnectedLayer(38)
softmaxLayer
classificationLayer];
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!