# HG changeset patch # User Olivier Delalleau # Date 1243995964 14400 # Node ID c60ad32e1f40bbe5795922d03705be01a4abc8ef # Parent 2a30f22ef7ffe4835e41fe139bb40e8078b40f92 Fix to the 'by_pair' corruption pattern diff -r 2a30f22ef7ff -r c60ad32e1f40 pylearn/algorithms/sandbox/DAA_inputs_groups.py --- a/pylearn/algorithms/sandbox/DAA_inputs_groups.py Tue Jun 02 14:40:43 2009 -0400 +++ b/pylearn/algorithms/sandbox/DAA_inputs_groups.py Tue Jun 02 22:26:04 2009 -0400 @@ -316,11 +316,11 @@ mask = self.random.binomial(T.shape(self.input), 1, 1 - self.noise_level) elif self.corruption_pattern == 'by_pair': shape = T.shape(self.input) - scale = numpy.ones(2) - scale[1] = 2 - shape = shape / scale + # Do not ask me why, but just doing "/ 2" does not work (there is + # a bug in the optimizer). + shape = T.stack(shape[0], (shape[1] * 2) / 4) mask = self.random.binomial(shape, 1, 1 - self.noise_level) - mask = T.hstack((mask, mask)) + mask = T.horizontal_stack(mask, mask) else: raise ValueError('Unknown value for corruption_pattern: %s' % self.corruption_pattern)