How do I find out the number of neurons?

11 visualizaciones (últimos 30 días)
Anindya Athaya Putri
Anindya Athaya Putri el 29 de Jul. de 2021
Respondida: Shivam Singh el 12 de Ag. de 2021
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?

Respuestas (1)

Shivam Singh
Shivam Singh el 12 de Ag. de 2021
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.

Categorías

Más información sobre Deep Learning Toolbox en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by