lenet5卷积神经网络过程_GitHub - 0x7dc/LeNet-5: 卷积神经网络之LeNet-5实现 The LeNet-5 Implementation of Convolutional...

LeNet-5

卷积神经网络之LeNet-5实现,代码参考了tiny-cnn(https://github.com/nyanp/tiny-cnn ),tiny-cnn这份开源代码质量还是挺高的,但是由于整个项目采用面向对象程序设计思路,外加c++泛型技术,如果想吃透整个项目,除了需要花些时间外,还需要技术功底的。本人在编写LeNet-5网络过程中,有些代码摘录自该项目,相比较而言,本工程更小巧,代码非常容易懂,也非常容易移植,完全不依赖第三方库。

但注意,实际在开发过程中没有用到F6层,主要包括2个卷积层、2个池化层、1个全连接层,外加输入及输出,共7层网络。实际训练时采用最大值池化、双曲正切激活函数,经过8轮迭代训练,手写数字识别准确率即达到99%。

The LeNet-5 implementation of the convolutional neural network is based on tiny-cnn (https://github.com/nyanp/tiny-cnn). Some of the code is extracted from this project. In comparison, my project is more compact, the code is very easy to understand, is also very easy to transplant, completely independent of third-party libraries.

But note that the actual development process is not used in the F6 layer, including two convolutions layers, two pool layers, a fully connected layer, and the input and output layer, a total of seven layers of the network. In practice, the maximal pooling and hyperbolic tangent activation function are adopted. After 8 rounds of iterative training, the accuracy of handwritten numeral recognition is 99%.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
LeNet-5神经网络 C源代码,这个写的比较好,可以用gcc编译去跑,结合理论可以对深度学习有更深刻的了解 介绍 根据YANN LECUN的论文《Gradient-based Learning Applied To Document Recognition》设计的LeNet-5神经网络,C语言写成,不依赖任何第三方库。 MNIST手写字符集初代训练识别率97%,多代训练识别率98%。 DEMO main.c文件为MNIST数据集的识别DEMO,直接编译即可运行,训练集60000张,测试集10000张。 项目环境 该项目为VISUAL STUDIO 2015项目,用VISUAL STUDIO 2015 UPDATE1及以上直接打开即可编译。采用ANSI C编写,因此源码无须修改即可在其它平台上编译。 如果因缺少openmp无法编译,请将lenet.c中的#include和#pragma omp parallel for删除掉即可。 API #####批量训练 lenet: LeNet5的权值的指针,LeNet5神经网络的核心 inputs: 要训练的多个图片对应unsigned char二维数组的数组,指向的二维数组的batchSize倍大小内存空间指针。在MNIST测试DEMO中二维数组为28x28,每个二维数组数值分别为对应位置图像像素灰度值 resMat:结果向量矩阵 labels:要训练的多个图片分别对应的标签数组。大小为batchSize batchSize:批量训练输入图像(二维数组)的数量 void TrainBatch(LeNet5 *lenet, image *inputs, const char(*resMat)[OUTPUT],uint8 *labels, int batchSize); #####单个训练 lenet: LeNet5的权值的指针,LeNet5神经网络的核心 input: 要训练的图片对应二维数组 resMat:结果向量矩阵 label: 要训练的图片对应的标签 void Train(LeNet5 *lenet, image input, const char(*resMat)[OUTPUT],uint8 label); #####预测 lenet: LeNet5的权值的指针,LeNet5神经网络的核心 input: 输入的图像的数据 labels: 结果向量矩阵指针 count: 结果向量个数 return 返回值为预测的结果 int Predict(LeNet5 *lenet, image input, const char(*labels)[LAYER6], int count); #####初始化 lenet: LeNet5的权值的指针,LeNet5神经网络的核心

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值