神经网络控制01 (英文)
- 格式:doc
- 大小:396.50 KB
- 文档页数:51
人工神经网络控制摘要: 神经网络控制,即基于神经网络控制或简称神经控制,是指在控制系统中采用神经网络这一工具对难以精确描述的复杂的非线性对象进行建模,或充当控制器,或优化计算,或进行推理,或故障诊断等,亦即同时兼有上述某些功能的适应组合,将这样的系统统称为神经网络的控制系统。
本文从人工神经网络,以及控制理论如何与神经网络相结合,详细的论述了神经网络控制的应用以及发展。
关键词: 神经网络控制;控制系统;人工神经网络人工神经网络的发展过程神经网络控制是20世纪80年代末期发展起来的自动控制领域的前沿学科之一。
它是智能控制的一个新的分支,为解决复杂的非线性、不确定、不确知系统的控制问题开辟了新途径。
是(人工)神经网络理论与控制理论相结合的产物,是发展中的学科。
它汇集了包括数学、生物学、神经生理学、脑科学、遗传学、人工智能、计算机科学、自动控制等学科的理论、技术、方法及研究成果。
在控制领域,将具有学习能力的控制系统称为学习控制系统,属于智能控制系统。
神经控制是有学习能力的,属于学习控制,是智能控制的一个分支。
神经控制发展至今,虽仅有十余年的历史,已有了多种控制结构。
如神经预测控制、神经逆系统控制等。
生物神经元模型神经元是大脑处理信息的基本单元,人脑大约含1012个神经元,分成约1000种类型,每个神经元大约与102~104个其他神经元相连接,形成极为错综复杂而又灵活多变的神经网络。
每个神经元虽然都十分简单,但是如此大量的神经元之间、如此复杂的连接却可以演化出丰富多彩的行为方式,同时,如此大量的神经元与外部感受器之间的多种多样的连接方式也蕴含了变化莫测的反应方式。
图1生物神经元传递信息的过程为多输入、单输出,神经元各组成部分的功能来看,信息的处理与传递主要发生在突触附近,当神经元细胞体通过轴突传到突触前膜的脉冲幅度达到一定强度,即超过其阈值电位后,突触前膜将向突触间隙释放神经传递的化学物质,突触有两种类型,兴奋性突触和抑制性突触。
神经⽹络(NeuralNetwork)⼀、激活函数激活函数也称为响应函数,⽤于处理神经元的输出,理想的激活函数如阶跃函数,Sigmoid函数也常常作为激活函数使⽤。
在阶跃函数中,1表⽰神经元处于兴奋状态,0表⽰神经元处于抑制状态。
⼆、感知机感知机是两层神经元组成的神经⽹络,感知机的权重调整⽅式如下所⽰:按照正常思路w i+△w i是正常y的取值,w i是y'的取值,所以两者做差,增减性应当同(y-y')x i⼀致。
参数η是⼀个取值区间在(0,1)的任意数,称为学习率。
如果预测正确,感知机不发⽣变化,否则会根据错误的程度进⾏调整。
不妨这样假设⼀下,预测值不准确,说明Δw有偏差,⽆理x正负与否,w的变化应当和(y-y')x i⼀致,分情况讨论⼀下即可,x为负数,当预测值增加的时候,权值应当也增加,⽤来降低预测值,当预测值减少的时候,权值应当也减少,⽤来提⾼预测值;x为正数,当预测值增加的时候,权值应当减少,⽤来降低预测值,反之亦然。
(y-y')是出现的误差,负数对应下调,正数对应上调,乘上基数就是调整情况,因为基数的正负不影响调整情况,毕竟负数上调需要减少w的值。
感知机只有输出层神经元进⾏激活函数处理,即只拥有⼀层功能的神经元,其学习能⼒可以说是⾮常有限了。
如果对于两参数据,他们是线性可分的,那么感知机的学习过程会逐步收敛,但是对于线性不可分的问题,学习过程将会产⽣震荡,不断地左右进⾏摇摆,⽽⽆法恒定在⼀个可靠地线性准则中。
三、多层⽹络使⽤多层感知机就能够解决线性不可分的问题,输出层和输⼊层之间的成为隐层/隐含层,它和输出层⼀样都是拥有激活函数的功能神经元。
神经元之间不存在同层连接,也不存在跨层连接,这种神经⽹络结构称为多层前馈神经⽹络。
换⾔之,神经⽹络的训练重点就是链接权值和阈值当中。
四、误差逆传播算法误差逆传播算法换⾔之BP(BackPropagation)算法,BP算法不仅可以⽤于多层前馈神经⽹络,还可以⽤于其他⽅⾯,但是单单提起BP算法,训练的⾃然是多层前馈神经⽹络。
Study on the Managing System of Fees Collecting by WaterMeter Based on CPU CardHUA Xiang-gang LIAN Xiao-gin WU Ye-lanABSTRACT:This paper introduces a managing system of fees coiiecting by water meter based on CPU card,shows the generai structure of this system,and expounds the functions of its main compositions and the concrete reaiization of these functions.KEY WORDS:CPU card;water meter;fees coiiecting system;information management system成用户卡密钥派生功能。
(4)总控卡。
总控卡密藏一个由发卡方相关人员产生的主控密钥,这个总控密钥通过和特定代码做加密运算产生水表SAM 模块,发行SAM 卡等的主工作密钥。
(5)检查卡。
主要在现场或生产过程中对水表的数据进行检查核对的卡片,为保证检查卡使用的方便性,检查卡对数据进行操作时不进行一卡一表的数据认证。
(6)生产数据设置卡。
主要在生产过程中对水表的参数进行设置。
(7)修改密钥卡。
用于将生产过程中使用的公开测试密钥更换为运行密钥。
(8)回收转移卡。
主要用于在现场进行换表操作时将旧表中的数据一次全部转移到新表中。
(9)校时卡。
主要用于在生产过程中或在现场运行状态下对水表中的时钟和日历进行调校。
(10)应急购水卡。
当水表内水量为零或透支状态时,用户可将应急购水卡中的购水量加入水表中以做应急使用。
由于CPU 卡具有大容量的优点,因此可在一张卡上开辟多个应用。
Neural Network & Fuzzy Control SystemsNotes #1: Neural Network笔记#1: (神经网络:反向增值学习的算法)笔记(英文)整理:陈恳1BACK PROPAGATION LEARNING ALGORITHMN(x)=S(y)=( S1(y1), S2(y2),, …, S p(y p) ); S(•): non-linear function.x and y are (1⨯n) and (1⨯p) vectors.d is the desired output, (1⨯p) vector.23e is the error signal, (1⨯p) vector.At iteration k, e k =d k – N(x k ) = d k – S(y k )=[ (d 1k – S(y 1k ), … , (d p k – S(y p k) ]Instantaneous summed squared error:Tkk pj kjj k jk e e y S d E 21))((2112∑==-=The error is observed at iteration k. Total error4∑==Tn k kEE 1n T : total error of data pair, (x 1,d 1; …; x nT ,d nT ).Back propagation learning algorithm minimizes k E at each iteration.Does this mean it also minimizes E?If each term of E is minimized, we expect that E is also minimized. Example:n=2, p=2, i.e., two inputs, two outputs.56y 1=m 11S 1(x 1) + m 21S 2(x 2) y 2=m 12S 1(x 1) + m 22S 2(x 2)Under the assumption, S i (x)= S (x), nonlinearity are the same.[y 1 y 2] = [S(x 1) S(x 2)] ⎥⎦⎤⎢⎣⎡22211211m m m m=[S(x 1) S(x 2)] •N ~Actual network output:[S(y 1) S(y 2)]=S(y)=N(x) Error: e 1=d 1- S(y 1) , e 2=d 2- S(y 2)7Since N~=⎥⎦⎤⎢⎣⎡22211211m m m m are the only variables, then we have tominimize E k with respect to these variables. Thisminimization is also known as the training of neural network.GRADIENT DESCENT ALGORITHMij kkij m E c k m ∂∂-=∆)( orij k km E c k m k m ∂∂-=-+)()1(we will consider two different networks:A)B)8Let’s look at the j th neuron at the output layer:910We simplifyby(See figure later page for a better view)11At k thiteration,;1qjk qj m E m c∂∂-=∆from the learning algorithm=qjkj kjk m y y E ∂∂∂∂-;but∑=qn qk qq qikjh S my )(; n q is the numberof neurons in hidden layer. For convenience, we take n q =p.=)(k qq kjk h S y E ∂∂-12=)()()(k qq kjk jj k jj k h S y y S y S E ∂∂∂∂-=)()()(/k qq k j jk jj k h S y Sy S E ∂∂-; but∑=-=pj kjj k jk y S d E 12))((21=)()())((/k qq k jj k jj k jh S y S y S d -Now consider q thneuron at the hidden layer,1314;1iqk iq m E m c∂∂-=∆from the learning algorithm=iqkq kqk m h h E ∂∂∂∂-;but∑==in i iqk ikqm xh 1;n i is the number of neurons in the input layer.=k ikqkxh E ∂∂-=kikqkqqkqqk xhhShSE∂∂∂∂-)()(=kikqqkqqk xhShSE)()(/∂∂-;=kikqqpjkqqkjkjk xhShSyyE)(])([/1∑=∂∂∂∂-(注意:∑,p个输出)=kikqqpjqjkjk xhSmyE)(][/1∑=∂∂-1516= k ik q q pj qj k jk jj k jj k xh S m yy S y S E )(])()([/1∑=∂∂∂∂-again∑=-=pj kjj k jk y S d E 12))((21=k ik qq pj qj k j jk jj k jxh S m y Sy S d)(])())(([/1/∑=--Here we used the chain rule of differentiation, i.e., if f=f(x 1, x 2,…,x n ) thenini ix d x f df ∑=∂∂=1The way we used this relation in our derivation is through17),...,,()(21k pk k k qq k y y y f h S E =∂∂ then=∂∂)(k qq k h S E ∑=∂∂∂∂pj k qq k j k jk h S yyE 1)(The reason we do this is the fact that it is difficult to evaluate)(k qq k h S E ∂∂ because it is not easy to see how much E k will change ifwe change )(k qq h S .B)Let’s now consider a neuron that belongs to layer G,1819On this figure, I also showed neurons that we considered before, namely neurons j and q. How do we train for the weight m sr ?;1srk sr m E m c∂∂-=∆ from the learning algorithm=sr kr krk m g g E ∂∂∂∂-; but∑==sn s srks skrm f Sg 1)(; n s is thenumber of neurons in the layer F.20=)(ks s krk f S g E ∂∂-=)()()(ks s krk ss k s s kf Sg g S g S E ∂∂∂∂-=)()()(/ks s k rr k rr k f S g S g S E ∂∂-;=)()(])([/1ks s kr r n q k rr k q k qk f S g S g S hhE q∑=∂∂∂∂-21=)()(][/1ks s k rr n q rq k qk f S g S m hE q∑=∂∂-=)()(])()([/1ks s k rr n q rq k qk qq k qq k f S g S m hh S h S E q∑=∂∂∂∂- =)()(])()([/1/ks s k rr n q rq k qqk qq k f S g S m h S h S E q∑=∂∂-=)()(})(])([{/1/1ks s k rr n q rq k qq pj k qq k j k jk f S g S m h S h S yyE q∑∑==∂∂∂∂-22=)()(})(][{/1/1ks s k rr n q rq k qq pj qj k jk f S g S m h S m yE q∑∑==∂∂-=)()(})(])()(([{/1/1/ks s k rr n q rq k qq pj qj k j jk jj k jf Sg S mh S m y Sy S dq∑∑==--The weight m sr can now be updated assr k sr sr m E ck m k m ∂∂-=+)()1(See next pages for the detailed weight connecttions.23kik qq pj qj k jjk jj k jiq x h S m y Sy S dm )(])()(([/1/∑=-=∆)()()]([(/k qq k jj k jj k jqj h S y S y S dm -=∆∑==ni k iiqk qx S mh1)(∑==pq k qqjk jh S my1)(2425THE NON-LINEAR FUNCTION Scxex S -+=11)(2')1()(cxcx ecex S --+==)1(1)1(cx cx cxe e ce---++ =)1(1)111(cxcxeec --++-=)())(1(x S x S c - Note: always positive.26The advantage of Sigmoid function lies with the easy evaluation of its derivative.If the network has to handle negative as well as positive numbers, the Sigmoid function can be shifted as)112()(-+=-cxeK x S=)11(cxcx ee K --+-Note that we don ’t just need to use the Sigmoid function only,27what we need is a monotone non-decreasing differentiable function to represent the non-linearity of neuron.Shifted Sigmoid function)(1)(c x g ee h e x S --+-+= g: gain2)(e h c S +=4)()(/e h gc S -= Recommended for most networks.28Step function S(x)=e if x<cS(x)=h if x>cUsed in earlier networks such as perception Hopfield, etc.. not differentiable.DISCUSSION ON GRADIENT DESCENT ALGORITHM ...|)(!2)(|)(!1)()()(00''20/00+-+-+===x x x x x f x x x f x x x f x fGiven the Taylor expansion above, let us say we want to find the min or max of f(x), then290)(/=x f...|)(!2)(2|)(00''0/=+-+==x x x x x f x x x fThis gives0|)(}|)({)(/1''0x x x x x f x f x x =-=-=-replace x 0=x(k) x=x(k+1)k x x c x f =-=1''}|)({030then)(|)()1(k x x kxf c k x k x =∂∂-=-+which corresponds to the training algorithm)(|)()1(k m m ij k ij ij ij ij m fc k m k m =∂∂-=-+SIMPLE EXAMPLE ON BACK PROPAGATIONLEARNING .Input: x=[-3.0 2.0]Desired output: d=[0.4 0.8]Let us see this on the diagramNow, we will create a neural network that will learn thisinput/output behavior.Here is the network:31Neuron 2 receives a constant input, so called bias. The relation may have non-zero output for zero input. This is why3233we use bias.We want to minimize),())((21,2,121221d x m m f y S d EE k kk=-==∑∑d 1=0.4 , d 2=0.8Since we have only two parameters (m 1, m 2), it is easy toconstruct the error surface graph as below.34Starting from an initial condition (marked by +), the graph demonstrates how the minimum is achieved by the gradient descent technique. Think of a marble with no inertia sliding down to the one of the lowest point the error surface graph.3536MOMENTUM ALGORITHM FOR BACKPROPAGATION We demonstrated that weight adjustments in back propagation algorithm are)()()1(k m c k m k m ij k ij ij ∆+=+where)()(k m E k m ij k ij ∂∂-=∆m ij (•)=follows a first order difference equation. More general updating can be accomplished by37)1()()()1(-∆+∆+=+k m b k m c k m k m ij k ij k ij ijThis third term is called the momentum term. The idea here is not to “forget ” the previous gradient term, i.e.,)1()1(1-∂∂-=-∆-k m E k m ij k ijso if there are sudden random changes in )(k m ij ∆, we willnot be immediately effected by it.To see how it works, consider the momentum update equation given above, i.e.,)]1()([)()()1(--+∆=-+k m k m b k m c k m k m ij ij k ij k ij ij38or)()()1(k m c k m b k m ij k ij k ij ∆=-+δδ)()1()(k m k m k m ij ij ij -+=δ a slight change of notation here.Applying z-transform,)()(][k m c k m b z ij k ij k ∆=-δ])([1)(11k m E zb zc k m ij kkij∂∂--=--δWe see that the weight changes are not immediately effected by the current gradient but it is effected by a low pass filtered current gradient.EXAMPLE: IDENTIFICATION BY NEURAL NETWORK394041x i : ith neuron of input layer X h i : ith neuron of hidden layer H y i : ith neuron of output layer Yerror at iteration k:)()()(^k y k y k e -=)(^k y = S(y 1))(212k e E k =∑==Tn k kEE 142A) Neuron at the output layer Y,)(11111111h S y E m y y E m E m ck k k ∂∂-=∂∂∂∂-=∂∂-=∆=)()()(1111h S y y S y S E k ∂∂∂∂-=)()()(11/1h S y S y S E k ∂∂-; 21))()((21y S k y E k -==)()())()((11/1h S y S y S k y -)()()1(111k m E ck m k m k ∂∂-=+43)112()(111-+=-y c ek y S])1(2[)(211/1111y c y c ee c k y S --+=For the second weight, the learning equation becomes)(12121122h S y E m y y E m E m ck k k ∂∂-=∂∂∂∂-=∂∂-=∆=)()()(2111h S y y S y S E k∂∂∂∂44=)()()(21/1h S y S y S E k∂∂;21))()((21y S k y E k -==)()())()((21/1h S y S y S k y - then,)()()1(222k m E ck m k m k ∂∂-=+B) Neuron in hidden layer,)(11131133x S h E m h h E m E m ck k k ∂∂-=∂∂∂∂-=∂∂-=∆=)()()(1111x S h h S h S E k ∂∂∂∂-45=)()()(11/1x S h S h S E k∂∂-=)()())((11/111x S h S h S y y E k∂∂∂∂-=)()()(11/11x S h S m y E k ∂∂-=)()())()((11/1111x S h S m y y S y S E k ∂∂∂∂-=)()()())()((11/11/1x S h S m y S y S k y -46Similarly,)(12242244x S h E m h h E m E m ck k k ∂∂-=∂∂∂∂-=∂∂-=∆=)()()(2222x S h h S h S E k ∂∂∂∂=)()()(22/2x S h S h S E k∂∂=)()())((12/211x S h S h S y y E k ∂∂∂∂=)()()(22/21x S h S m y E k ∂∂47=)()())()((22/2111x S h S m y y S y S E k ∂∂∂∂=)()()())()((22/21/1x S h S m y S y S k y -5m ∆, 6m ∆ are left to you as an exercise.Note also thatS(x 1)= x 1=y(k-1) if S(•)=1 S(x 2)= x 2=u(k-1)EXAMPLEWhat does the neural network learn?Hint: e→ 0, y^→x48NEURAL NETWORKS AS PREDICTORS ORSIMULATORS TRAINING49After training y(t)=y^(t)Using neural network as a predictor.50。