# HG changeset patch # User Olivier Delalleau # Date 1243432779 14400 # Node ID 98a99aafd14a4fe424be73729740af4baebefe2f # Parent d42b4bcbb5822aacbb218767dff8c17996fd8b4a# Parent 2881c67026c1456454c0276115783dc36f5cbafe Merged diff -r 2881c67026c1 -r 98a99aafd14a pylearn/sandbox/scan_inputs_groups.py --- 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