How do I find out the number of neurons?

조회 수: 18 (최근 30일)
Anindya Athaya Putri
Anindya Athaya Putri 2021년 7월 29일
답변: Shivam Singh 2021년 8월 12일
Dear all,
I have this code for training neural network
Dataset = imageDatastore('Dataset', 'IncludeSubfolders', true, 'LabelSource', 'foldernames');
[Training_Dataset, Validation_Dataset, Testing_Dataset] = splitEachLabel(Dataset, 0.7, 0.15, 0.15);
net = googlenet;
analyzeNetwork(net)
Input_Layer_Size = net.Layers(1).InputSize(1:2);
Resized_Training_Dataset = augmentedImageDatastore(Input_Layer_Size ,Training_Dataset);
Resized_Validation_Dataset = augmentedImageDatastore(Input_Layer_Size ,Validation_Dataset);
Resized_Testing_Dataset = augmentedImageDatastore(Input_Layer_Size, Testing_Dataset);
Feature_Learner = net.Layers(142).Name;
Output_Classifier = net.Layers(144).Name;
Number_of_Classes = numel(categories(Training_Dataset.Labels));
New_Feature_Learner = fullyConnectedLayer(Number_of_Classes, ...
'Name', 'PV Feature Learner', ...
'WeightLearnRateFactor', 10, ...
'BiasLearnRateFactor', 10);
New_Classifier_Layer = classificationLayer('Name', 'PV Classifier');
Network_Architecture = layerGraph(net);
New_Network = replaceLayer(Network_Architecture, Feature_Learner, New_Feature_Learner);
New_Network = replaceLayer(New_Network, Output_Classifier, New_Classifier_Layer);
analyzeNetwork(New_Network)
Minibatch_Size = 4;
Validation_Frequency = floor(numel(Resized_Training_Dataset.Files)/Minibatch_Size);
Training_Options = trainingOptions('sgdm', ...
'MiniBatchSize', Minibatch_Size, ...
'MaxEpochs', 15, ...
'InitialLearnRate', 3e-4, ...
'Shuffle', 'every-epoch', ...
'ValidationData', Resized_Validation_Dataset, ...
'ValidationFrequency', Validation_Frequency, ...
'Verbose', false, ...
'Plots', 'training-progress');
net = trainNetwork(Resized_Training_Dataset, New_Network, Training_Options);
I need to know how many neurons are in layers? Does anyone have any idea?

답변 (1개)

Shivam Singh
Shivam Singh 2021년 8월 12일
You can display the total number of learnable parameters of each layer in the output displayed by analyzeNetwork function by clicking on the arrow in the top-right corner of the layer table and selecting “Total Learnables”.
As of the current release there is no straightforward way to find the Total number of Learnables of the network. This is known to the concerned people, and they might provide support to this feature in the future release.

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by