版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Updates of Equilibrium Prop Match Gradients of Backprop Through Time in an RNN with Static Input Maxence Ernoult1,2, Julie Grollier2, Damien Querlioz1, Yoshua Bengio3,4, Benjamin Scellier3 1Centre de Nanosciences et de Nanotechnologies, Universit Paris Sud, Universit Paris-Saclay 2Unit Mixte de Phys
2、ique, CNRS, Thales, Universit Paris-Sud, Universit Paris-Saclay 3Mila, Universit de Montral 4Canadian Institute for Advanced Research Abstract Equilibrium Propagation (EP) is a biologically inspired learning algorithm for convergent recurrent neural networks, i.e. RNNs that are fed by a static input
3、xand settle to a steady state. Training convergent RNNs consists in adjusting the weights until the steady state of output neurons coincides with a targety. Convergent RNNs can also be trained with the more conventional Backpropagation Through Time (BPTT) algorithm. In its original formulation EP wa
4、s described in the case of real-time neuronal dynamics, which is computationally costly. In this work, we introduce a discrete-time version of EP with simplifi ed equations and with reduced simulation time, bringing EP closer to practical machine learning tasks. We fi rst prove theoretically, as wel
5、l as numerically that the neural and weight updates of EP, computed by forward-time dynamics, are step-by-step equal to the ones obtained by BPTT, with gradients computed backward in time. The equality is strict when the transition function of the dynamics derives from a primitive function and the s
6、teady state is maintained long enough. We then show for more standard discrete-time neural network dynamics that the same property is approximately respected and we subsequently demonstrate training with EP with equivalent performance to BPTT. In particular, we defi ne the fi rst convolutional archi
7、tecture trained with EP achieving 1%test error on MNIST, which is the lowest error reported with EP. These results can guide the development of deep neural networks trained with EP. 1Introduction The remarkable development of deep learning over the past years LeCun et al., 2015 has been fostered by
8、the use of backpropagation Rumelhart et al., 1985 which stands as the most powerful algorithm to train neural networks. In spite of its success, the backpropagation algorithm is not biologically plausible Crick, 1989, and its implementation on GPUs is energy-consuming Editorial, 2018. Hybrid hardwar
9、e-software experiments have recently demonstrated how physics and dynamics can be leveraged to achieve learning with energy effi ciency Romera et al., 2018, Ambrogio et al., 2018. Hence the motivation to invent novel learning algorithms where both inference and learning could fully be achieved out o
10、f core physics. Many biologically inspired learning algorithms have been proposed as alternatives to backpropagation to train neural networks. Contrastive Hebbian learning (CHL) has been successfully used to train recurrent neural networks (RNNs) with static input that converge to a steady state (or
11、 equilibrium), such as Boltzmann machines Ackley et al., 1985 and real-time Hopfi eld networks Movellan, 1991. CHL proceeds in two phases, each phase converging to a steady state, where the learning rule accommodates the difference between the two equilibria. Equilibrium Propagation (EP) Scellier an
12、d Bengio, 2017 also belongs to the family of CHL algorithms to train RNNs with static input. 33rd Conference on Neural Information Processing Systems (NeurIPS 2019), Vancouver, Canada. In the second phase of EP, the prediction error is encoded as an elastic force nudging the system towards a second
13、equilibrium closer to the target. Interestingly, EP also shares similar features with the backpropagation algorithm, and more specifi cally recurrent backpropagation (RBP) Almeida, 1987, Pineda, 1987. It was proved in Scellier and Bengio 2019 that neural computation in the second phase of EP is equi
14、valent to gradient computation in RBP. Originally, EP was introduced in the context of leaky-integrate neurons Scellier and Bengio, 2017, 2019. Computing their dynamics involves long simulation times, hence limiting EP training experiments to small neural networks. In this paper, we propose a discre
15、te-time formulation of EP. This formulation allows demonstrating an equivalence between EP and BPTT in specifi c conditions, simplifi es equations and speeds up training, and extends EP to standard neural networks including convolutional ones. Specifi cally, the contributions of the present work are
16、 the following: We introduce a discrete-time formulation of EP (Section 3.1) of which the original real-time formulation can be seen as a particular case (Section 4.2). We show a step-by-step equality between the updates of EP and the gradients of BPTT when the dynamics converges to a steady state a
17、nd the transition function of the RNN derives from a primitive function (Theorem 1, Figure 1). We say that such an RNN has the property of gradient-descending updates (or GDU property). We numerically demonstrate the GDU property on a small network, on fully connected layered and convolutional archi
18、tectures. We show that the GDU property continues to hold approximately for more standard prototypical neural networks even if these networks do not exactly meet the requirements of Theorem 1. We validate our approach with training experiments on different network architectures using discrete-time E
19、P, achieving similar performance than BPTT. We show that the number of iterations in the two phases of discrete-time EP can be reduced by a factor three to fi ve compared to the original real-time EP, without loss of accuracy. This allows us training the fi rst convolutional architecture with EP, re
20、aching 1%test error on MNIST, which is the lowest test error reported with EP. Our code is available on-line in Pytorch 1. 2Background This section introduces the notations and basic concepts used throughout the paper. 2.1Convergent RNNs With Static Input We consider the supervised setting where we
21、want to predict a target y given an input x. The model is a dynamical system - such as a recurrent neural network (RNN) - parametrized byand evolving according to the dynamics: st+1= F (x,st,).(1) We callFthe transition function. The input of the RNN at each timestep is static, equal tox. Assuming c
22、onvergence of the dynamics before time stepT, we havesT= swheresis such that s= F (x,s,).(2) We calls the steady state (or fi xed point, or equilibrium state) of the dynamical system. The number of timestepsTis a hyperparameter chosen large enough to ensuresT= s. The goal of learning is to optimize
23、the parameter to minimize the loss: L= (s,y),(3) where the scalar functionis called cost function. Several algorithms have been proposed to optimize the lossL, including Recurrent Backpropagation (RBP) Almeida, 1987, Pineda, 1987 and Equilibrium Propagation (EP) Scellier and Bengio, 2017. Here, we p
24、resent Backpropagation Through Time (BPTT) and Equilibrium Propagation (EP) and some of the inner mechanisms of these two algorithms, so as to enunciate the main theoretical result of this paper (Theorem 1). 1 2 Figure 1: Illustration of the property of Gradient-Descending Updates (GDU property).Top
25、 left. Forward-time pass (or fi rst phase) of an RNN with static inputxand targety . The fi nal statesTis the steady states.Bottom left.Backprop through time (BPTT).Bottom right.Second phase of equilibrium prop (EP). The starting state in the second phase is the fi nal state of the fi rst phase, i.e
26、. the steady states.GDU Property (Theorem 1).Step by step correspondence between the neural updatesEP s (t)in the second phase of EP and the gradientsBPTT s (t)of BPTT. Corresponding computations in EP and BPTT at timestept = 0(resp.t = 1,2,3) are colored in green (resp. blue, red, yellow). Forward-
27、time computation in EP corresponds to backward-time computation in BPTT. 2.2Backpropagation Through Time (BPTT) With frameworks implementing automatic differentiation, optimization by gradient descent using Backpropagation Through Time (BPTT) has become the standard method to train RNNs. In particul
28、ar BPTT can be used for a convergent RNN such as the one that we study here. To this end, we consider the loss afterT iterations (i.e. the cost of the fi nal statesT), denotedL = (sT,y), and we substitute L as a proxy 2 for the loss at the steady state L. The gradients of L can be computed with BPTT
29、. In order to state our Theorem 1 (Section 3.2), we recall some of the inner working mechanisms of BPTT. Eq. (1) can be rewritten in the formst+1= F (x,st,t+1= ), wheretdenotes the parameter of the model at time stept, the valuebeing shared across all time steps. This way of rewriting Eq. (1) enable
30、s us to defi ne the partial derivative L t as the sensitivity of the lossLwith respect totwhen1,.t1,t+1,.T remain fi xed (set to the value). With these notations, the gradient L reads as the sum: L = L 1 + L 2 + + L T .(4) BPTT computes the full gradient L by computing the partial derivatives L st a
31、nd L t iteratively and effi ciently, backward in time, using the chain rule of differentiation. Subsequently, we denote the gradients that BPTT computes: t 0,T 1 : BPTT s (t) = L sTt BPTT (t) = L Tt , (5) 2The difference between the loss L and the loss L is explained in Appendix B.1. 3 so that L = T
32、1 X t=0 BPTT (t).(6) More details about BPTT are provided in Appendix A.2. 3Equilibrium Propagation (EP) - Discrete Time Formulation 3.1Algorithm In its original formulation, Equilibrium Propagation (EP) was introduced in the case of real-time dynamics Scellier and Bengio, 2017, 2019. The fi rst the
33、oretical contribution of this paper is to adapt the theory of EP to discrete-time dynamics.3EP is an alternative algorithm to compute the gradient ofLin the particular case where the transition functionFderives from a scalar function, i.e. with F of the form F(x,s,) = s(x,s,). In this setting, the d
34、ynamics of Eq. (1) rewrites: t 0,T 1,st+1= s (x,st,).(7) This constitutes the fi rst phase of EP. At the end of the fi rst phase, we have reached steady state, i.e. sT= s. In the second phase of EP, starting from the steady states, an extra term s (whereis a positive scaling factor) is introduced in
35、 the dynamics of the neurons and acts as an external force nudging the system dynamics towards decreasing the cost function. Denotings 0,s 1,s 2,.the sequence of states in the second phase (which depends on the value of ), the dynamics is defi ned as s 0 = sandt 0,s t+1= s ? x,s t, ? s ? s t,y ? .(8
36、) The network eventually settles to a new steady states . It was shown in Scellier and Bengio 2017 that the gradient of the lossLcan be computed based on the two steady statessands . More specifi cally, 4 in the limit 0, 1 ? ?x,s , ? (x,s,) ? L .(9) In fact, we can prove a stronger result. For fi xe
37、d 0 we defi ne the neural and weight updates t 0 : EP s (,t) = 1 ? s t+1 s t ? , EP (,t) = 1 ? ? x,s t+1, ? ? x,s t, ? , (10) and note that Eq. (9) rewrites as the following telescoping sum: X t=0 EP (,t) L as 0.(11) We can now state our main theoretical result (Theorem 1 below). 3.2Forward-Time Dyn
38、amics of EP Compute Backward-Time Gradients of BPTT BPTT and EP compute the gradient of the loss in very different ways: while the former algorithm iteratively adds up gradients going backward in time, as in Eq. (6), the latter algorithm adds up weight updates going forward in time, as in Eq. (11).
39、In fact, under a condition stated below, the sums are equal term by term: there is a step-by-step correspondence between the two algorithms. 3We explain in Appendix B.2 the relationship between the discrete-time setting (resp. the primitive function ) of this paper and the real-time setting (resp. t
40、he energy function E) of Scellier and Bengio 2017, 2019. 4The EP learning rule is a form of contrastive Hebbian learning similar to that of Boltzmann machines Ackley et al., 1985 and similar to the one presented in Movellan 1991. 4 Theorem 1(Gradient-Descending Updates, GDU).Consider the setting wit
41、h a transition function of the formF (x,s,) = s (x,s,). Lets0,s1,.,sTbe the convergent sequence of states and denotes= sTthe steady state. If we further assume that there exists some stepKwhere0 W (s),(13) where?is a discretization parameter,is an activation function andWis a symmetric weight matrix
42、. In this setting, we considerEP(?,t)instead ofEP(,t)and writeEP(t)for simplicity, so that: EP s (t) = s? t+1 s ? t ? ,EP W (t) = 1 ? ? s? t+1 ? ? s? t+1 ? ? s? t ? ? s? t ? .(14) With?as a primitive function and with the hyperparameterrescaled by a factor?, we recover the discretized version of the
43、 real-time setting of Scellier and Bengio 2017, i.e. the Euler scheme of ds dt = E s s withE = 1 2ksk 2(s)W (s)see Appendix B.2, where the link between discrete-time dynamics and real-time dynamics is explained. Fig. 2 qualitatively demonstrates Theorem 1 in this setting on a toy model. Prototypical
44、 setting.In this case, the dynamics of the system does not derive from a primitive function . Instead, the dynamics is directly defi ned as: st+1= (W st).(15) Again,Wis assumed to be a symmetric matrix. The dynamics of Eq. (15) is a standard and simple neural network dynamics. Although the model is
45、not defi ned in terms of a primitive function, note that st+1 s (st,W)with(s,W) = 1 2s W sif we ignore the activation function. Following Eq. (10), we defi ne: EP s (t) = 1 ? s t+1 s t ? ,EP W (t) = 1 ? s t+1 s t+1 s t s t ? .(16) 4.3Effect of Depth and Approximation We consider a fully connected la
46、yered architecture where layerssnare labelled in a backward fashion:s0denotes the output layer,s1the last hidden layer, and so forth. Two consecutive layers are reciprocally connected with tied weights with the convention thatWn,n+1connectssn+1tosn. We study this architecture in the energy-based and
47、 prototypical setting as described per Equations (13) and (15) respectively, with corresponding weight updates (14) and (16) - see details in Appendix C.3 and C.4. We study the GDU property layer-wise, e.g. RelMSE(EP sn, -BPTTsn ) measures the distance between the EP sn and BPTT sn processes, averag
48、ed over all elements of layer sn. We display in Fig. 3 the RelMSE, layer-wise for one, two and three hidden layered architecture (from left to right), in the energy-based (upper panels) and prototypical (lower panels) settings, so that each architecture in a given setting is displayed in one panel -
49、 see Appendix C.3 and C.4 for a detailed description of the hyperparameters and curve samples. In terms of RelMSE, we can see that the GDU property is best satisfi ed in the energy-based setting with one hidden layer where RelMSE is around 102(top left). When adding more hidden layers in the energy-
50、based setting (top middle and top right), the RelMSE increases to 101, with a greater RelMSE when going away from the output layer. The same is observed in the prototypical setting when we add more hidden layers (lower 6 Figure 3: RelMSE analysis in the energy-based (top) and prototypical (bottom) s
51、etting. For one given architecture, each bar is labelled by a layer or synapses connecting two layers, e.g. the orange bar aboves1representsRelMSE(EP s1 ,BPTT s1 ). For each architecture, the recurrent hyperparameters T, K and have been tuned to make the EPand BPTTprocesses match best. panels). Comp
52、ared to the energy-based setting, although the RelMSEs associated with neurons are signifi cantly higher in the prototypical setting, the RelMSEs associated with synapses are similar or lower. On average, the weight updates provided by EP match well the gradients of BPTT, in the energy-based setting
53、 as well as in the prototypical setting. 4.4Convolutional Architecture Figure 4: Demonstrating the GDU property with the convolutional architecture on MNIST. Dashed and continuous lines representEPandBPTTprocesses respectively, for 5 randomly selected neurons (top) and synapses (bottom) in each laye
54、r. Each randomly selected neuron or synapse corresponds to one color. Dashed and continuous lines mostly coincide. SomeEPprocesses collapse to zero as an effect of the non-linearity, see Appendix D for details. Interestingly, theEP s and BPTT s processes are saw-teeth-shaped ; Appendix C.6 accounts
55、for this phenomenon. In our convolutional architecture,hnandsndenote convolutional and fully connected layers respec- tively.Wfc n,n+1andW conv n,n+1denote the fully connected weights connectingsn+1tosn and the fi lters connecting hn+1to hn , respectively. We defi ne the dynamics as: sn t+1 = ? Wfc
56、nn+1 s n+1 t + Wfc n1n s n1 t ? hn t+1 = ? P ?Wconv n,n+1 h n+1 t ? + Wconv n1,n P1 ?hn1 t ? , (17) whereandP denote convolution and pooling, respectively. Transpose convolution is defi ned through the convolution by the fl ipped kernel WconvandP1denotes inverse pooling - see Appendix D for a 7 Tabl
57、e 1: Training results on MNIST with EP benchmarked against BPTT, in the energy-based and prototypical settings. EB and P respectively denote energy-based and prototypical, -#h stands for the number of hidden layers and WCT for Wall-clock time inhours : minutes. We indicate over fi ve trials the mean
58、 and standard deviation for the test error, the mean error in parenthesis for the train error. T (resp. K) is the number of iterations in the fi rst (resp. second) phase. EP (error %)BPTT (error %)TKEpochsWCT TestTrainTestTrain EB-1h2.06 0.17(0.13)2.11 0.09(0.46)10012301 : 33 EB-2h2.01 0.21(0.11)2.02 0.12(0.29)500405016 : 04 P-1h2.00 0.13(0.20)2.00 0.12(0.
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年天津市河西区中小学教师招聘考试备考题库及答案详解
- 2026年周口市川汇区中小学教师招聘笔试参考试题及答案详解
- 2025年辽阳市弓长岭区街道办人员招聘考试试题及答案详解
- 永新县商务局招聘公益性岗位笔试参考题库及答案详解
- 2026年福州市马尾区中小学教师招聘考试参考题库及答案详解
- 2026年天津市北辰区街道办人员招聘笔试备考题库及答案详解
- 2026年福建省漳州市中小学教师招聘考试模拟试题及答案详解
- 2026年邯郸市邯山区法检系统书记员招聘笔试参考题库及答案详解
- 2026年湛江市坡头区中小学教师招聘考试模拟试题及答案详解
- 2026年贵阳市乌当区街道办人员招聘考试参考题库及答案详解
- 2026年肾内科医生三基三严培训试卷及答案
- 2026年哈尔滨市道里区六年级下学期期末英语试题及答案
- 2026湖北武汉市区属国有企业招聘笔试历年参考题库附带答案详解
- 护理人员的情绪管理与礼仪
- 2026上海博物馆公开招聘12名工作人员考试备考试题及答案解析
- 2026年高考化学终极冲刺:专题03 化学反应原理综合题(大题专练逐空突破)(全国适用)(原卷版及解析)
- 中医诊断学之诊断思路与诊断方法
- GB/T 31458-2026医院安全防范要求
- 实验室触电培训
- 政协提案知识培训讲稿
- 《2025年宁夏社区工作者招聘考试高频考点试题解析》
评论
0/150
提交评论