Commits

Takafumi Arakaki  committed 0b643cd

move src. loc. of ElmanNet.dUcdUc

  • Participants
  • Parent commits be40bc0

Comments (0)

Files changed (1)

File pyrnn/elmannet.py

         self.ns.dEdUo = delta * self.ns.dXodUo
         self.ns.Eto   = delta**2 / 2.0
 
-    def dUcdUc(self,t):
-        "return matrix dUc'[t+1]/dUc[t]"
-        ec = self.ns.ec
-        wcc = self.ns.wcc
-        dXcdUc = self.ns.dXcdUc
-        dot = numpy.dot
-        diag = numpy.diag
-        return diag(1-ec) + dot(diag(ec),dot(wcc,diag(dXcdUc[t])))
-
     def bptt(self):
         xc = self.ns.xc
         xi = self.ns.xi
             dEdBc[:] += dEdUc[t]
         ## dEdUc[0] += dot(dEdUo[0],woc)*dXcdUc[0]
         ## dEdWoc[:] += outer(dEdUo[0],xc[0])
-        ## dEdBo[:] += dEdUo[t]
-        ## dEdBc[:] += dEdUc[0]
+        ## dEdBo[:] += dEdUo[0]
+        dEdBc[:] += dEdUc[0]
+
+    def dUcdUc(self,t):
+        "return matrix dUc'[t+1]/dUc[t]"
+        ec = self.ns.ec
+        wcc = self.ns.wcc
+        dXcdUc = self.ns.dXcdUc
+        dot = numpy.dot
+        diag = numpy.diag
+        return diag(1-ec) + dot(diag(ec),dot(wcc,diag(dXcdUc[t])))
 
     def reset_grad(self):
         for var in self.ns.get_vars(['dEdUc','dEdBo','dEdBc',