Is my CNN Correct

4 visualizzazioni (ultimi 30 giorni)
Reem
Reem il 26 Lug 2025
Risposto: Walter Roberson il 26 Lug 2025
Is my CNN Correct ( It works in my data but I need to confirm it with expert review)
% CNN Definition
layers = [
sequenceInputLayer(1)
convolution1dLayer(5,16,'Padding','same')
batchNormalizationLayer
reluLayer
convolution1dLayer(3,32,'Padding','same')
batchNormalizationLayer
reluLayer
globalAveragePooling1dLayer
fullyConnectedLayer(16)
reluLayer
fullyConnectedLayer(2)
softmaxLayer
classificationLayer
];
options = trainingOptions('adam', ...
'InitialLearnRate',0.001, ...
'MaxEpochs',30, ...
'MiniBatchSize',128, ...
'Shuffle','every-epoch', ...
'Verbose',false, ...
'ExecutionEnvironment','auto', ...
'Plots','none');
net = trainNetwork(XTrain, categorical(YTrain), layers, options);

Risposte (2)

Chuguang Pan
Chuguang Pan il 26 Lug 2025
You can use analyzeNetwork fucntion to obtain more details of your neural network
layers = [
sequenceInputLayer(1)
convolution1dLayer(5,16,'Padding','same')
batchNormalizationLayer
reluLayer
convolution1dLayer(3,32,'Padding','same')
batchNormalizationLayer
reluLayer
globalAveragePooling1dLayer
fullyConnectedLayer(16)
reluLayer
fullyConnectedLayer(2)
softmaxLayer
]; % classificationLayer is not recommended
cnnNet = dlnetwork(layers);
input = dlarray(rand(1,20,1024),"CBT");
% analyzeNetwork(cnnNet,input) % analyzeNetwork is not supported in online

Walter Roberson
Walter Roberson il 26 Lug 2025
There are definitely more than 10 possible layers at any point.
Your system has 12 layers.
Therefore there are over 10^12 possible combinations for 12 layers.
We have no possible way of knowing whether your one network is "the" correct network out of 10^12 possibilities.
The most we could talk about is whether it is a plausible arrangement of layers for some purpose. There is absolutely no way for us to know that it is the one true network... since you did not even describe your needs.

Categorie

Scopri di più su Deep Learning Toolbox in Help Center e File Exchange

Tag

Prodotti


Release

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by