I have built a CNN using the Matlab Neural Network Toolbox. How can I calculate the total number of parameters used in my network?
For example, I can use the analyzeNetwork() from the support addon, and this can show me the number of learnable parameters per layer. Would it be correct to add these up?
layers = [
imageInputLayer([128 300 1])
convolution2dLayer([7 7], 32, 'Stride', [2 2], 'Padding', 1)
batchNormalizationLayer
reluLayer
convolution2dLayer([5 5], 32, 'Stride', [2 2], 'Padding', 1)
batchNormalizationLayer
reluLayer
convolution2dLayer([3 3], 64, 'Stride', [2 2],'Padding', 1)
batchNormalizationLayer
reluLayer
dropoutLayer(0.2)
convolution2dLayer([3 3], 64, 'Stride', [2 2],'Padding', 1)
batchNormalizationLayer
reluLayer
dropoutLayer(0.2)
convolution2dLayer([8 1], 1024, 'Stride', [1 1],'Padding', 0)
batchNormalizationLayer
reluLayer
dropoutLayer(0.2)
averagePooling2dLayer([1 12],'Stride', [1 1]);
dropoutLayer(0.2)
fullyConnectedLayer(4096)
batchNormalizationLayer
reluLayer
dropoutLayer(0.2)
fullyConnectedLayer(1251)
softmaxLayer
classificationLayer];
imageSizeandnumClasses? Please add this to your question.