# HG changeset patch # User Eric Thibodeau-Laufer # Date 1309890670 14400 # Node ID cb2e07d99f5a1268a169a680b2911e9e9c704557 # Parent f7b348e6a98e97c2fe65badace275216a270d26b switched inp==0 to T.eq(inp,0) in peppersalt noise diff -r f7b348e6a98e -r cb2e07d99f5a pylearn/formulas/noise.py --- a/pylearn/formulas/noise.py Tue Jul 05 11:02:15 2011 -0400 +++ b/pylearn/formulas/noise.py Tue Jul 05 14:31:10 2011 -0400 @@ -63,7 +63,7 @@ """ assert inp.dtype in ['float32','float64'] return theano_rng.binomial( size = inp.shape, n = 1, p = 1 - noise_lvl[0], dtype=inp.dtype) * inp \ - + (inp==0) * theano_rng.binomial( size = inp.shape, n = 1, p = noise_lvl[1], dtype=inp.dtype) + + (theano.tensor.eq(inp,0)) * theano_rng.binomial( size = inp.shape, n = 1, p = noise_lvl[1], dtype=inp.dtype) @tags.tags('noise','gauss','gaussian') def gaussian_noise(theano_rng,inp,noise_lvl):