increase number of hidden layers
3 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Srivardhan Gadila
on 3 May 2020
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 Comments
See Also
Categories
Find more on Image Data Workflows in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!