首页 > 解决方案 > Deep Conv Model 参数个数

问题描述

我正在阅读此声明:

具有两个 5x5 卷积层的 CNN(第一个具有 32 个通道,第二个具有 64 个通道,每个具有 2x2 最大池化),一个具有 512 个单元和 ReLu 激活的全连接层,以及一个最终的 softmax 输出层(总共 1,663,370 个参数)

我看不出他们是如何计算 1.6m 参数的。相同的网络实现给了我大约 580k 个参数,考虑到这是一个小型网络,这更加现实。

标签: machine-learningdeep-learningcomputer-visionartificial-intelligenceconv-neural-network

解决方案


假设你在谈论 MNIST 图像,1 个输入通道,stride=1,padding=2

INPUT:    [28x28x1]   weights: 0
CONV5-32: [28x28x32]  weights: (1*5*5)*32 + 32  =       832 
POOL2:    [14x14x32]  weights: 0
CONV5-64: [14x14x64]  weights: (5*5*32)*64 + 64 =    51,264 
POOL2:    [7x7x64]    weights: 0
FC:       [1x1x512]   weights: 7*7*64*512 + 512 = 1,606,144
Softmax:  [1x1x10]    weights: 512*10 + 10      =     5,130 
-----------------------------------------------------------
                                                  1,663,370

推荐阅读