machine-learning - Deep Conv Model 参数个数
问题描述
我正在阅读此声明:
具有两个 5x5 卷积层的 CNN(第一个具有 32 个通道,第二个具有 64 个通道,每个具有 2x2 最大池化),一个具有 512 个单元和 ReLu 激活的全连接层,以及一个最终的 softmax 输出层(总共 1,663,370 个参数)
我看不出他们是如何计算 1.6m 参数的。相同的网络实现给了我大约 580k 个参数,考虑到这是一个小型网络,这更加现实。
解决方案
假设你在谈论 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
推荐阅读
- web-scraping - 此版本的 ChromeDriver 仅支持 Chrome 版本 78
- c++ - 错误 - “初始化”:无法从“glm::vec2”转换为“glm::vec3”
- python - 由于张量 ID,将 numpy 数组转换为张量时出现奇怪的错误
- python - 为 Python C 扩展实现单元测试
- arrays - System.Array.FindAll () 的问题
- reactjs - React 无法读取地图的属性
- spring - 对于 DataSource 和 JMS 事务同步,除了 JmsTransactionManager 之外,我还需要在 JmsTemplate 中配置 setTransacted 吗?
- mod-wsgi - 在 Django/mod_wsgi 虚拟环境中配置 WSGIPythonHome 的问题
- angular - 根据角度的特定条件查看另一个组件中的特定组件
- visual-studio - 如何将 Visual Studio 项目从 Windows 切换到 Linux 容器?