MAKE YOUR OWN NEURAL NETWORK

MAKE YOUR OWN NEURAL NETWORK 阅读笔记

最终成果:实现一个简单的BP三层的神经网络,实例为识别mnist上面的数字数据集

1.首先简短介绍一下神经网络的样子

生物里学到是这样的
我们学到的应该是这样的
然后用在计算机里面就是这样的了,生物当中的神经元会有一个阈值,达到阈值之后神经元被激活再向后传播,模型当中会有一个阈值函数,本书当中使用sigmoid函数将输出控制在0~1之间
计算机里面的
之后,我们要用这个模型做分类

2.再讲一下信号源如何在神经元当中传输

用一个简单的两层,每层两个的神经元做介绍
输入输出两层
从上到下分别输入1.0, 0.5,每一层神经元到下一层每一个神经元的连接的阈值随机分配值,值分布在0~1之间,可以得到以下的简单模型:
4
然后我们把值带进去计算,模拟一下,计算的模型如下:
5
我们就可以得到sum input的结果
x计算结果
得到sum之后通过sigmoid函数得到最终的output y
7
但是这样计算表示起来过于复杂,引入矩阵的运算
8
通过这样运算达到了效果,也更加简介,方便调用后面代码中numpy矩阵运算的库

3.我们正向传播描述结束,接下来要讲述一下如何反向传播,修正神经元之间连接的权重

9
我们首次随机权重,定会有很大的错误,权重更大的需要更改的更多,所以我们把错误按照权重占比反向传播,最终每一条边都会分到错误的份额。接着会汇聚到神经元上,神经元得到错误的综合,然后向后继续按照权重传播。
神经元错误的计算公式
反向传播实例1
反向传播实例2
到此,我们已经完成错误的分配,下面要开始update神经元之间连接的权重了

4. 使用梯度下降确定神经元之间的权重

书中的插图非常的形象,当我们要找一条下山的路时候,就是走到最低的地方,这里就类似于我们要找cost函数的最小值,我们每一次向下迈出一步的时候都会选择最陡的路。
炒鸡形象
我们学过如何找最陡的路,就是求偏导。在我们的反向传播的神经网络中损失函数为:我们只要这样求偏导就行
(目前还不会用latex写数学公式,使用截图和拍照)
新手手写
手动推导了一下,最终得到结果
这是神经网络的核心
update
final
我们拿到这个式子之后已经知道如何更新神经元之间的权值了,接下来就是写代码实现了,之后再更。
需要英文版书的call我。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
A step-by-step gentle journey through the mathematics of neural networks, and making your own using the Python computer language. Neural networks are a key element of deep learning and artificial intelligence, which today is capable of some truly impressive feats. Yet too few really understand how neural networks actually work. This guide will take you on a fun and unhurried journey, starting from very simple ideas, and gradually building up an understanding of how neural networks work. You won't need any mathematics beyond secondary school, and an accessible introduction to calculus is also included. The ambition of this guide is to make neural networks as accessible as possible to as many readers as possible - there are enough texts for advanced readers already! You'll learn to code in Python and make your own neural network, teaching it to recognise human handwritten numbers, and performing as well as professionally developed networks. Part 1 is about ideas. We introduce the mathematical ideas underlying the neural networks, gently with lots of illustrations and examples. Part 2 is practical. We introduce the popular and easy to learn Python programming language, and gradually builds up a neural network which can learn to recognise human handwritten numbers, easily getting it to perform as well as networks made by professionals. Part 3 extends these ideas further. We push the performance of our neural network to an industry leading 98% using only simple ideas and code, test the network on your own handwriting, take a privileged peek inside the mysterious mind of a neural network, and even get it all working on a Raspberry Pi. All the code in this has been tested to work on a Raspberry Pi Zero.

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值