Commits

Takafumi Arakaki  committed d26eb5a

fb_rate[t,o]

  • Participants
  • Parent commits 9ebcb6a

Comments (0)

Files changed (1)

File pyrnn/elmannet.py

         self.ns.make_update_for(['woc','wcc','wci','bo','bc'])
         self.ns.dUc0 = numpy.zeros((num_c,), dtype=numpy.float)
 
-        self.fb_rate  = 1
+        self.fb_rate  = numpy.ones((steps, num_o,), dtype=numpy.float)
         self.fb_delay = numpy.ones((num_o,), dtype=numpy.int)
         
         self.set_activation()
         xo[:dmax] = to[:dmax]
         xc[dmax-1] = avc(uc[dmax-1])
         for t in self.ns.time_step[dmax:]:
-            xi[t,:No] = [ fbr * xo[t-d0,o0] + (1 - fbr) * to[t-d0,o0]
-                          for (o0, d0) in enumerate(fbd) ]
+            xi[t,:No] = [fbr[t,o0] * xo[t-d0,o0] + (1-fbr[t,o0]) * to[t-d0,o0]
+                         for (o0, d0) in enumerate(fbd)]
             uc[t] = (1-ec)*uc[t-1] + ec*(dot(wci,xi[t])+dot(wcc,xc[t-1])+bc)
             xc[t] = avc(uc[t])
             uo[t] = dot(woc,xc[t])+bo