def apply_noise(computation_graph, variables, level, seed=None):
 if (not seed):
  seed = config.default_seed
 rng = MRG_RandomStreams(seed)
 replace = {}
 for variable in variables:
  replace[variable] = (variable + rng.normal(variable.shape, std=level))
 return computation_graph.replace(replace)

def apply_noise ( computation_graph , variables , level , seed = None ) : if ( not seed ) : seed = config . default_seed rng = MRG_RandomStreams ( seed ) replace = { } for variable in variables : replace [ variable ] = ( variable + rng . normal ( variable . shape , std = level ) ) return computation_graph . replace ( replace )
add gaussian noise to certain variable of a computation graph .