# HG changeset patch # User Frederic Bastien # Date 1286996716 14400 # Node ID 9a7dbcd0ebcfed70a4f273a13e19168f647cb9cb # Parent 1b97fae7ea0d3873aca21fefd6d2398b6259fad1 make function documentation more clear. diff -r 1b97fae7ea0d -r 9a7dbcd0ebcf pylearn/formulas/noise.py --- a/pylearn/formulas/noise.py Wed Oct 13 15:04:42 2010 -0400 +++ b/pylearn/formulas/noise.py Wed Oct 13 15:05:16 2010 -0400 @@ -56,7 +56,10 @@ :type inp: Theano variable :param inp: The input that we want to add noise :type noise_lvl: tuple(float,float) - :param noise_lvl: The %% of noise for the salt and pepper. Between 0 (no noise) and 1. + :param noise_lvl: The probability of changing each element to zero or one. + (prob of salt, prob of pepper) + + :note: The sum of the prob of salt and prob of pepper should be less then 1. """ assert inp.dtype in ['float32','float64'] return theano_rng.binomial( size = inp.shape, n = 1, p = 1 - noise_lvl[0], dtype=inp.dtype) * inp \