fixed c typos, math error in nnet_ops.py
author |
James Bergstra <bergstrj@iro.umontreal.ca> |
date |
Wed, 27 Aug 2008 17:08:33 -0400 |
parents |
643dbccde1fc |
children |
|
rev |
line source |
414
|
1 def binomial(input, rstate, p = 0.75):
|
|
2 """
|
|
3 Op to corrupt an input with binomial noise.
|
|
4 Generate a noise vector of 1's and 0's (1 with probability p).
|
|
5 We multiply this by the input.
|
|
6
|
|
7 @note: See U{ssh://projects@lgcm.iro.umontreal.ca/repos/denoising_aa}
|
|
8 to see how rstate is used.
|
|
9 """
|
|
10 noise = rstate.gen_like(('binomial',{'p': p, 'n': 1}), input)
|
|
11 noise.name = 'noise'
|
|
12 return noise * input
|
|
13
|