fully connected layer in a CNN
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Jyoti Nautiyal
il 27 Set 2020
Commentato: Jyoti Nautiyal
il 2 Ott 2020
I trained a CNN for MNIST dataset with one fully connected layer. The input to fully connected layer is 9 channels of size 20 x 20, and ouput is 10 classes. How can i calculate the total number of multiplications and additions in this layer.
0 Commenti
Risposta accettata
Srivardhan Gadila
il 1 Ott 2020
You can use the analyzeNetwork to view the network architecture, shape of layerwise Activations & Learnables etc.
Based on the above information and under the assumption that your fullyConnectedLayer is having bias as Learnables then the layer has an input vector of size 4000 (i.e., 20x20x10 flattened) and the size of Weights & Bias are 10x4000, 10x1 respectively.
The general operation of fullyConnectedLayer is Z = W*X + b => 10*4000 = 40,000 multiplications and 39,990 + 10 = 40,000 additions.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Deep Learning Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!