numcodecs_uniform_noise

Function add_uniform_noise

Source
pub fn add_uniform_noise<T: FloatExt, S: Data<Elem = T>, D: Dimension>(
    data: ArrayBase<S, D>,
    scale: T,
    seed: u64,
) -> Array<T, D>
where Open01: Distribution<T>,
Expand description

Adds U(-scale/2, scale/2) uniform random noise to the input data.

This function first hashes the input and its shape to then seed a pseudo- random number generator that generates the uniform noise. Therefore, passing in the same input with the same seed will produce the same noise and thus the same output.