1 Star 5 Fork 2

Green / numpy_cnn

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

numpy_cnn

介绍

使用 numpy 自己实现 cnn,学习神经网络的前向与反向传播,激活函数,以及numpy api

具体包括:

激活函数:

  • sigmoid
  • relu
  • softmax

网络层:

  • 激活函数层
  • reshape层
  • 全连接层(full connected layer)
  • 平均池化层(mean-pooling layer)
  • 卷积层(convolution layer)

博客

【python】如何用 numpy 实现 CNN

感想

  • 我写这些代码只是为了学习算法,没有仔细考虑效率和准确率(python写的,效率不会高到哪里去)

  • 我的网络框架借鉴了 pytorch 和 tensorflow,体会到了这些框架设计上的合理性。

    比如说卷积时 kernel_size, stride,input_size 之间的约束关系 —— 我记得卷积核是要能够扫过input张量所有行和列(例如28x28,不能用 (5x5,stride=2)卷积,因为它只能扫过 27x27)。以前不懂,自己写完后发现这涉及到反向传播计算的问题,如果约束不满足,还得加 zeros_padding,非常多余。

  • 很多事情说起来容易,做起来难。以前看了不少关于神经网络原理的博客,结果自己动手后发现有很多细节问题自己根本没注意过。

参考资料

  • np.einsum (爱因斯坦求和约定)—— 相当方便的 API

https://zhuanlan.zhihu.com/p/27739282

http://www.atyun.com/32288.html

  • BP 反向传播

https://blog.csdn.net/qq_36393962/article/details/97421557

  • softmax

https://blog.csdn.net/cassiePython/article/details/80089760

  • 池化层

https://blog.csdn.net/googler_offer/article/details/81208413

https://blog.csdn.net/m_buddy/article/details/80426531

  • 卷积层

https://blog.csdn.net/qq_16137569/article/details/81477906

https://www.cnblogs.com/charlotte77/p/7783261.html

https://www.zhihu.com/question/22298352/answer/228543288

https://blog.csdn.net/gqixf/article/details/83579009

https://www.jianshu.com/p/8dfe02b61686

(2020-5-23 添加)

  • 多通道卷积

https://blog.csdn.net/csuyzt/article/details/82026408

https://blog.csdn.net/weixin_40519315/article/details/105115657

MIT License Copyright (c) 2020 Green Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

使用 numpy 自己实现 cnn,学习神经网络的前向与反向传播,激活函数,以及numpy api 具体包括: 激活函数: sigmoid, relu, softmax 网络层: 激活函数层,reshape层,全连接层(full connected layer),平均池化层(average-pooling layer),卷积层(convolution layer) 使用 MNIST 数据集验证有效性 展开 收起
Python
MIT
取消

发行版 (1)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/bitosky/numpy_cnn.git
git@gitee.com:bitosky/numpy_cnn.git
bitosky
numpy_cnn
numpy_cnn
master

搜索帮助