# HG changeset patch # User Xavier Glorot # Date 1244229113 14400 # Node ID c95a56f055aa88678f15985b0ed36af22ec9f2ac # Parent f02dc24dad8f073607e403fe900c055c247a2795 added a totallocal_update method to StackedDAAig diff -r f02dc24dad8f -r c95a56f055aa pylearn/algorithms/sandbox/DAA_inputs_groups.py --- a/pylearn/algorithms/sandbox/DAA_inputs_groups.py Wed Jun 03 14:25:56 2009 -0400 +++ b/pylearn/algorithms/sandbox/DAA_inputs_groups.py Fri Jun 05 15:11:53 2009 -0400 @@ -607,8 +607,17 @@ self.globalupdate[-1] = theano.Method(self.inputs[-1],self.globalcost[-1],global_grads) if self.totalupdatebool: self.totalupdate[-1] = theano.Method(self.inputs[-1],self.totalcost[-1],total_grads) + + totallocal_grads={} + for k in range(self.depth): + totallocal_grads.update(dict((j, j - self.unsup_lr * g) for j,g in + zip(self.daaig[k].params,self.localgradients[k]))) + totallocal_grads.update(dict((j, j - self.sup_lr * g) for j,g in zip(self.daaig[-1].params,self.localgradients[-1]))) + self.totallocalupdate = theano.Method(self.inputs[-1],sum(self.localcost[:]),totallocal_grads) + self.classify = theano.Method(self.inputs[-2],self.daaig[-1].argmax_standalone) self.NLL = theano.Method(self.inputs[-1],self.daaig[-1]._xent) + if self.debugmethod: self.compute_localcost[-1] = theano.Method(self.inputs[-1],self.localcost[-1])