Is my CNN Correct

6 ビュー (過去 30 日間)
Reem
Reem 2025 年 7 月 26 日
回答済み: Walter Roberson 2025 年 7 月 26 日
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);

回答 (2 件)

Chuguang Pan
Chuguang Pan 2025 年 7 月 26 日
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 2025 年 7 月 26 日
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.

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

タグ

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by