您好,欢迎访问三七文档
当前位置:首页 > IT计算机/网络 > AI人工智能 > 2.4补充BP神经网络计算实例
2020/2/10复习神经网络的用途分类预测(拟合、回归)1x1w2x2wiixw-f()ynxnw单个神经元的神经网络输入输入输入神经元输出1112121222313231,,...,2,,...,3,,...,......nnnXxxxXxxxXxxx111122112112222231132233nnnnnnxwxwxwyxwxwxwyxwxwxwyx11x1nx12X11112111121222223331323,,...,,,...,,,...,nnnxxxwyxxxwyWXYwyxxx2020/2/10神经网络的工作原理xi(i=1,2,…,n)是输入,wi为该神经元与各输入间的连接权值,为阈值,yo为输出(1)从各输入端接收输入信号xi。(2)根据各连接权值wi,求出所有输入的加权和yi:yi=ni=1wixi-(3)利用某一特征函数f进行变换,得到输出yo:yo=f(yi)=f(ni=1wixi-)2020/2/10神经元间连接权值的含义连接权wij通常在[-1,1]之间取值:wij0,称为正连接,表示神经元j对i有激活作用wij0,称为负连接,表示神经元j对i有抑制作用神经网络的各种学习算法的不同特点反映在调整权值的原则、方法、步骤和迭代过程的参数选择上。2020/2/10感知器和线性神权网络的局限只能解决线性可分问题线性可分线性不可分2020/2/102.4补充BP神经网络计算实例智能中国网提供学习支持逻辑异或问题—线性不可分在二维空间中没有可分离点集{(0,0),(1,1)}和{(0,1),(1,0)}的直线2020/2/10逻辑异或问题线性不可分考虑一感知器,其输入为X1,X2;权值为W1,W2;阀值是。为了学习这个函数,网络必须找到这样一组值,它满足如下的不等式方程:W1*1+W2*1,真值表的第一行;W1*1+0,真值表的第二行;0+W2*1,真值表的第三行;0+0或为正数,最后一行。此不等式方程组无解,这就证明了感知机不能解决异或问题。问题不是线性可分的,这是异或问题不能用感知机来解决的原因2020/2/10BP神经网络求解异或问题BP学习算法推导BP标准算法网络学习算法\ihhoww()(()())()(1())oooookdkyokyokyok1()(())f(())qhohohokkwhik1.初始值选择2.前向计算,求出所有神经元的输出3.对输出层计算4.从后向前计算各隐层5.计算并保存各权值修正量:6.修正权值:7.判断是否满足结束条件,不满足转至2,否则算法结束1()()()NNwkwkwk()wk2020/2/10BP神经网络求解异或问题网络结构设初始权值全部为0.5,阈值为0,学习率为0.5,输入层到隐含层,隐含层到输出值的激活函数为单极SIGMOID函数,要求误差e为0.1Node1Node2Node1Node2Node1X1X2w11w12w21w22w1yw2yyo2020/2/10BP神经网络求解异或问题的权值调整输入样本(1,1,0)时,求解各对应参数:各神经元的输出111122122122221112211122(0)(0)(0)(0)(0)10.510.51(0)(0)(0)(0)(0)11(0)()0.73111(0)()0.7311(0)(0)(0)(0)(0)0.7310.50.7310.50.731(0)((0))yyhixwxwhixwxwhofhiehofhieyihowhowyofyi0.73110.6751e1212y1输入层隐含层输出层w11w12w21w22w1y1w2y11()()nihihhihikwxkb()f(())hhhokhik1()()poohohhyikwhokb()f(())ooyokyikX1(k)X2(k)1(()())()()oooNNhohohdkyokyokwwhokqohoho=1N+1Nihihi(d(k)w)f(hi(k))w=w+hx(k)2020/2/10BP神经网络求解异或问题的权值调整反向传播调整各权值隐含层与输出层之间的权值调整计算:(0)((0)(0))(0)(1(0))(00.675)0.675(10.675)0.148odyoyoyo11101112210222(0)(0)(0)0.50.1480.7310.054(0)(0)(0)0.50.0540.554(0)(0)(0)0.054(0)(0)(0)0.554yoyyyyoyyywho1212y1输入层隐含层输出层w11w12w21w22w1y1w2y11()()nihihhihikwxkb()f(())hhhokhik1()()poohohhyikwhokb()f(())ooyokyikX1(k)X2(k)1(()())()()oooNNhohohdkyokyokwwhokqohoho=1N+1Nihihi(d(k)w)f(hi(k))w=w+hx(k)2020/2/10BP神经网络求解异或问题的权值调整反向传播调整各权值输入层与隐含层之间的权值调整计算:1111122221111211(0)((0)(0))f((0))(0)(0)(0)(0)(1(0))0.1480.50.731(10.731)0.015(0)(0)(0)(0)(1(0))0.015(0)(0)(0)0.50.01510.007(0)(0)qhohohohoyhoyhhwhiwhohowhohowxwx2(0)0.50.01510.0071212y1输入层隐含层输出层w11w12w21w22w1y1w2y11()()nihihhihikwxkb()f(())hhhokhik1()()poohohhyikwhokb()f(())ooyokyikX1(k)X2(k)1(()())()()oooNNhohohdkyokyokwwhokqohoho=1N+1Nihihi(d(k)w)f(hi(k))w=w+hx(k)2020/2/10BP神经网络求解异或问题的权值调整10111111102121211221222210121212(0)(0)(0)0.50.0070.507(0)(0)(0)0.50.0070.507(0)(0)(0)0.50.01510.007(0)(0)(0)0.50.01510.007(0)(0)(0)0.50.0070.507hh10222222(0)(0)(0)0.50.0070.507ww反向传播调整各权值输入层与隐含层之间的权值调整计算:1212y1输入层隐含层输出层w11w12w21w22w1y1w2y11()()nihihhihikwxkb()f(())hhhokhik1()()poohohhyikwhokb()f(())ooyokyikX1(k)X2(k)1(()())()()oooNNhohohdkyokyokwwhokqohoho=1N+1Nihihi(d(k)w)f(hi(k))w=w+hx(k)2020/2/10BP神经网络求解异或问题的权值调整计算误差:因为误差没有达到预定要求,进入下一轮权值调整循环2211()(00.675)0.22822edyo1212y1输入层隐含层输出层w11w12w21w22w1y1w2y11()()nihihhihikwxkb()f(())hhhokhik1()()poohohhyikwhokb()f(())ooyokyikX1(k)X2(k)1(()())()()oooNNhohohdkyokyokwwhokqohoho=1N+1Nihihi(d(k)w)f(hi(k))w=w+hx(k)2020/2/10思考题激活函数为logsig函数时,对网络有何影响?当输入分别为0.6和0.8时,通过计算判断将会将其分入哪一类
本文标题:2.4补充BP神经网络计算实例
链接地址:https://www.777doc.com/doc-3620577 .html