refactor: fix _add_noise
This commit is contained in:
parent
9a154f01e4
commit
aff4cb227c
@ -456,9 +456,9 @@ class SimulatedDataMonitor(SimulatedDataBase):
|
|||||||
v = np.random.poisson(v)
|
v = np.random.poisson(v)
|
||||||
return v
|
return v
|
||||||
elif noise == NoiseType.UNIFORM:
|
elif noise == NoiseType.UNIFORM:
|
||||||
noise = np.random.uniform(-1, 1) * noise_multiplier
|
noise = np.ceil(np.random.uniform(0, 1) * noise_multiplier).astype(int)
|
||||||
v += noise
|
v += noise * (np.random.randint(0, 2) * 2 - 1)
|
||||||
return v if v > 0 else v
|
return v if v > 0 else 0
|
||||||
return v
|
return v
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user