changeset 725:98a99aafd14a

Merged
author Olivier Delalleau <delallea@iro>
date Wed, 27 May 2009 09:59:39 -0400
parents d42b4bcbb582 (diff) 2881c67026c1 (current diff)
children 2014db81b9bc
files
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/sandbox/scan_inputs_groups.py	Tue May 26 18:45:09 2009 -0400
+++ b/pylearn/sandbox/scan_inputs_groups.py	Wed May 27 09:59:39 2009 -0400
@@ -573,8 +573,6 @@
     Currently, the gradient is computed as if the input value was really zero.
     It may be safer to replace the gradient w.r.t. missing values with either
     zeros or missing values (?).
-    ***NOTE*** This is a debug implementation using a special code for missing
-    values (-123456)
     """
 
     def __init__(self, constant_val=0):
@@ -590,8 +588,7 @@
     def make_node(self, input):
         return Apply(self, [input], [input.type(), input.type()])
 
-    def perform(self, node, inputs, output_storage):
-        input = inputs[0]
+    def perform(self, node, (input, ), output_storage):
         out = output_storage[0]
         out[0] = input.copy()
         out = out[0]
@@ -599,7 +596,7 @@
         mask[0] = numpy.ones(input.shape)
         mask = mask[0]
         for (idx, v) in numpy.ndenumerate(out):
-            if v == -123456:
+            if numpy.isnan(v):
                 out[idx] = self.constant_val
                 mask[idx] = 0