一个用于学习C语言数据结构和深度学习的长期项目
使用numpy构建多层感知机的模型进行训练,再将训练后的模型存储为C数组的形式,便于使用C进行部署。
多层感知机的运算依赖于矩阵运算的实现,仓库中使用C语言实现了神经网络需要的基本的矩阵运算。
想要C运行的结果和numpy训练的结果一致,就需要设计相同的网络结构,依赖于建立的矩阵运算库,C代码会自动读取python训练得到的参数维度并构建相同的模型结构进行运算。
仓库中实现了多层感知机拟合实现异或门的例子。
项目中只实现了最基本的多层感知机,也就是多输入单输出的神经网络。
-
训练时发现当输入层比第一层网络的节点数少一个节点,并且网络节点数以此递减时,cost下降会比较顺畅自然
-
学习率的调节和训练次数需要根据实际情况进行调整
-
加入softmax实现多分类任务
-
使用图片数据进行分类训练
-
使用抑梯度参数初始化以使参数初始化更合理
-
使用dropout和正则化使网络推理更高效
-
实现基础的卷积神经网络