[6] CHANG machine learning notes, a short introduction to Deep Learning

[1] CHANG machine learning notes, regression (Regression)

[CHANG machine learning notes] 2, error resulting from where?

[CHANG machine learning notes] 3, gradient descent

[CHANG machine learning notes] 4, Classification

[CHANG machine learning notes] 5, Logistic Regression

[6] CHANG machine learning notes, a short introduction to Deep Learning

------------------------------------------------------------------------------------------------------

[Video] CHANG depth of reinforcement learning Address: https://www.bilibili.com/video/av10590361?p=13

Courseware Address: http://speech.ee.ntu.edu.tw/~tlkagk/courses_ML17_2.html

-------------------------------------------------------------------------------------------------------

 Start to introduce the history and current situation point depth of learning, in short, is a word, is fire!

Prior to the course, said machine learning is divided into three steps, deep learning, too.

Step1: the definition of a neural network model

 Examples of the above article notes, a number of Logistic Regression string together to form a neural network (Neural Network).

Different connections neurons will form many different networks.

Parameters of the network  \theta represents a collection of all neurons (Neuron) of the weight and bias.

That different neurons (or Logistic Regression) how it pick up? There are many more common is Fully Connect Feedforward Network.

Fully Connect Feedforward Network

如图,共有6个神经元。每个神经元都有一个weight和bias。weight和bias是通过training找出来的。

以图中为例子,输入1和-1,经过1*1+(-1)*(-2)+ 1=4,再经过 sigmoid function就得到0.98。

当weight和bias都知道的话,整个network就是一个普通function,输入[1,-1],输出[0.62,0.83] ;输入[0,0],输出[0.51,0.85] 

weight和bias的数值有无穷个,每一组参数代表一个function,所以network就是一个function set(model)。

和刚才的例子类似,所有神经元排成一层一层的样子。

输入的地方就是Input Layer,输出的地方就是Output Layer。中间就统称Hidden Layers。 

Deep就是指有很多层Hidden Layers。

注意:这些深层网络并不是单纯的叠出来的,像ResidualNet,中间是还有用快捷链路这样的特殊组件。

Matrix Operation

Neural Network的运算可以看成是矩阵运算。如上图所示。\sigma ()代表sigmoid函数。 

可以看到,每一层都可以用 这样的方式来计算。

所以,整个网络做的就只是一连串嵌套的 wx+b 的矩阵运算。

把整个网络做成矩阵运算的好处就是:可以调用GPU并行计算来加速运算。

Output Layer

中间Hidden Layers可以看做是一个feature extractor。它做的事情,就类似于上篇笔记讲到的feature engineering做的事情(feature transformation等等),将原本没办法分类的feature转换成能被分类的feature。

所以Output Layer以这些转换后的feature作为输入,经过Softmax函数,就实现 Multi-class Classifier。

手写数字识别的例子

输入图片分辨率为16*16,总共256维。假设有字迹的格子数值为1,否则为0 。

输入256维,输出为10维。10维代表识别为每一个数字的几率。

 这个例子中,知道输入为256维(图片分辨率16*16),输出为10维。

中间Hidden Layers多少层,每一层多少个神经元,这些都没有一个合理的根据去确定,就只能根据你的经验和直觉去设定

(也有自动设定网络架构的方法,比如evolutionary neural networks,这个有兴趣自己找资料了解下)

Step 2:评价一个函数的好坏

估测出的y_1……y_{10}和target值 y_1\hat、……、y_{10}\hat,结合两者就能算出Cross Entropy。

Loss Function就是所有的 Cross Entropy 的和。训练的目的就是找出一组weight和bias,能使Loss Function的值最小化。

更新参数的方法用gradient descent。

step 3:找出最好的函数 

 就是对L求偏微分,然后乘上learning rate,作为更新量。不断重复这个过程。(gradient descent更具体的内容可以看第一篇笔记

发布了23 篇原创文章 · 获赞 36 · 访问量 5万+

Guess you like

Origin blog.csdn.net/ACL_lihan/article/details/104342700