Exemple #1
0
 def _setDerivatives(self, d, owner=None):
     """ put slices of this array back into the modules """
     ParameterContainer._setDerivatives(self, d, owner)
     index = 0
     for x in self._containerIterator():
         x._setDerivatives(self.derivs[index:index + x.paramdim], self)
         index += x.paramdim
Exemple #2
0
 def _setDerivatives(self, d, owner=None):
     ParameterContainer._setDerivatives(self, d, owner)
     nrNeurons = self.outdim
     first, second = 0, 0
     first, second = second, second + indim * nrNeurons
     self.ingateConnDerivs = self.derivs[first:second]
     first, second = second, second + indim * nrNeurons
     self.forgetgateConnDerivs = self.derivs[first:second]
     first, second = second, second + indim * nrNeurons
     self.cellConnDerivs = self.derivs[first:second]
     first, second = second, second + indim * nrNeurons
     self.outgateConnDerivs = self.derivs[first:second]
     first, second = second, second + nrNeurons * nrNeurons
     self.ingateRecConnDerivs = self.derivs[first:second]
     first, second = second, second + nrNeurons * nrNeurons
     self.forgetgateRecConnDerivs = self.derivs[first:second]
     first, second = second, second + nrNeurons * nrNeurons
     self.cellRecConnDerivs = self.derivs[first:second]
     first, second = second, second + nrNeurons * nrNeurons
     self.outgateRecConnDerivs = self.derivs[first:second]
     if self.peep:
         first, second = second, second + nrNeurons
         self.ingatePeepDerivs = self.derivs[first:second]
         first, second = second, second + nrNeurons
         self.forgetgatePeepDerivs = self.derivs[first:second]
         first, second = second, second + nrNeurons
         self.outgatePeepDerivs = self.derivs[first:second]
Exemple #3
0
 def _setDerivatives(self, d, owner = None):
     ParameterContainer._setDerivatives(self, d, owner)
     nrNeurons = self.outdim
     first, second = 0, 0
     first, second = second, second + indim*nrNeurons
     self.ingateConnDerivs = self.derivs[first:second]
     first, second = second, second + indim*nrNeurons
     self.forgetgateConnDerivs = self.derivs[first:second]
     first, second = second, second + indim*nrNeurons
     self.cellConnDerivs = self.derivs[first:second]
     first, second = second, second + indim*nrNeurons
     self.outgateConnDerivs = self.derivs[first:second]
     first, second = second, second + nrNeurons*nrNeurons
     self.ingateRecConnDerivs = self.derivs[first:second]
     first, second = second, second + nrNeurons*nrNeurons
     self.forgetgateRecConnDerivs = self.derivs[first:second]
     first, second = second, second + nrNeurons*nrNeurons
     self.cellRecConnDerivs = self.derivs[first:second]
     first, second = second, second + nrNeurons*nrNeurons
     self.outgateRecConnDerivs = self.derivs[first:second]
     if self.peep:
         first, second = second, second + nrNeurons
         self.ingatePeepDerivs = self.derivs[first:second]
         first, second = second, second + nrNeurons
         self.forgetgatePeepDerivs = self.derivs[first:second]
         first, second = second, second + nrNeurons
         self.outgatePeepDerivs = self.derivs[first:second]
Exemple #4
0
 def _setDerivatives(self, d, owner=None):
     ParameterContainer._setDerivatives(self, d, owner)
     size = self.dim
     self.ingatePeepDerivs = self.derivs[:size]
     self.forgetgatePeepDerivs = \
         self.derivs[size:size * (1 + self.dimensions)]
     self.outgatePeepDerivs = \
         self.derivs[size * (1 + self.dimensions):]        
Exemple #5
0
 def _setDerivatives(self, d, owner=None):
     ParameterContainer._setDerivatives(self, d, owner)
     size = self.dim
     self.ingatePeepDerivs = self.derivs[:size]
     self.forgetgatePeepDerivs = \
         self.derivs[size:size * (1 + self.dimensions)]
     self.outgatePeepDerivs = \
         self.derivs[size * (1 + self.dimensions):]
Exemple #6
0
 def _setDerivatives(self, d, owner = None):
     ParameterContainer._setDerivatives(self, d, owner)
     dim = self.outdim
     self.ingatePeepDerivs = self.derivs[:dim]
     self.forgetgatePeepDerivs = self.derivs[dim:dim*2]
     self.outgatePeepDerivs = self.derivs[dim*2:]
Exemple #7
0
 def _setDerivatives(self, d, owner=None):
     ParameterContainer._setDerivatives(self, d, owner)
     dim = self.outdim
     self.ingatePeepDerivs = self.derivs[:dim]
     self.forgetgatePeepDerivs = self.derivs[dim:dim * 2]
     self.outgatePeepDerivs = self.derivs[dim * 2:]