def rand_nonzero(shape, eps=0.0003):
 r = numpy.asarray(numpy.random.rand(*shape), dtype=config.floatX)
 r = ((r * (1 - eps)) + (eps * (r >= 0.5)))
 r = ((r * 2) - 1)
 return r

def rand_nonzero ( shape , eps = 0.0003 ) : r = numpy . asarray ( numpy . random . rand ( * shape ) , dtype = config . floatX ) r = ( ( r * ( 1 - eps ) ) + ( eps * ( r >= 0.5 ) ) ) r = ( ( r * 2 ) - 1 ) return r
like rand .