# HG changeset patch # User Xavier Glorot # Date 1250030242 14400 # Node ID 316817114b155e32194f6a6ee36e48fe470cfd8d # Parent 96d5114b7a8ef11de0faad2f1b58b02cb0763e65 small changes for quadratic and global update DAA input groups diff -r 96d5114b7a8e -r 316817114b15 pylearn/algorithms/sandbox/DAA_inputs_groups.py --- a/pylearn/algorithms/sandbox/DAA_inputs_groups.py Mon Aug 10 19:12:11 2009 -0400 +++ b/pylearn/algorithms/sandbox/DAA_inputs_groups.py Tue Aug 11 18:37:22 2009 -0400 @@ -9,6 +9,7 @@ scanmaskenc,scanmaskdec, FillMissing, mask_gradient from pylearn.algorithms.logistic_regression import LogRegN +import pylearn.algorithms.cost from pylearn.io import filetensor import os @@ -613,7 +614,7 @@ if self.regularize: self.regularizationenccost[i] = self.regularizationenccost[i-1]+self.daaig[i-1].regularizationenc if i else 0 self.localcost[i] += self.daaig[i].regularization - self.globalcost[i] += self.regularizationenccost[i] + self.globalcost[i] += self.regularizationenccost[i] + self.daaig[i].regularization if self.totalupdatebool: self.totalcost[i] += self.daaig[i].regularization @@ -866,12 +867,12 @@ for i in range(self.depth): if typeup == 'local': cost[i] = inst.localupdate[i](*data[i]) - if typeup == 'global': + else: cost[i] = inst.globalupdate[i](*data[i]) else: if typeup == 'local': cost[layer] = inst.localupdate[layer](*data) - if typeup == 'global': + else: cost[layer] = inst.globalupdate[layer](*data) if printcost: print cost