changeset 810:3a4bc4a0dbf4

Changes in global updates to add local updates (avoid to lose information in the representation) DAA inputs groups
author Xavier Glorot <glorotxa@iro.umontreal.ca>
date Wed, 12 Aug 2009 19:19:24 -0400
parents a66bef83e1fd
children ecae21a7262e
files pylearn/algorithms/sandbox/DAA_inputs_groups.py
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/algorithms/sandbox/DAA_inputs_groups.py	Wed Aug 12 18:29:18 2009 -0400
+++ b/pylearn/algorithms/sandbox/DAA_inputs_groups.py	Wed Aug 12 19:19:24 2009 -0400
@@ -863,9 +863,9 @@
         else: 
             if typeup == 'total':
                 if layer == 'all':
-                    cost[-1] = inst.totalupdate[-1](*data)
+                    cost[-1] = inst.totalupdate[-1](*data[-1])
                 else:
-                    cost[layer] = inst.totalupdate[layer](*data)
+                    cost[layer] = inst.totalupdate[layer](*data[layer])
             else:
                 if layer is 'all':
                     for i in range(self.depth):
@@ -873,11 +873,15 @@
                             cost[i] = inst.localupdate[i](*data[i])
                         if typeup == 'global':
                             cost[i] = inst.globalupdate[i](*data[i])
+                            for j in range(i):
+                                dummy = inst.localupdate[j](*data[j])
                 else:
                     if typeup == 'local':
-                        cost[layer] = inst.localupdate[layer](*data)
+                        cost[layer] = inst.localupdate[layer](*data[layer])
                     if typeup == 'global':
-                        cost[layer] = inst.globalupdate[layer](*data)
+                        cost[layer] = inst.globalupdate[layer](*data[layer])
+                        for j in range(layer):
+                            dummy = inst.localupdate[j](*data[j])
         if printcost:
             print cost
         return cost