nvidia.dali.fn.noise.shot

nvidia.dali.fn.noise.shot(*inputs, **kwargs)

Applies shot noise to the input.

The shot noise is generated by applying the following formula:

output[:] = poisson_dist(max(0, input[:] / factor)) * factor) if factor != 0
output[:] = input[:]                                          if factor == 0

where poisson_dist represents a poisson distribution.

Shot noise is a noise that’s present in data generated by a Poisson process, like registering photons by an image sensor. This operator simulates the data acquisition process where each event increases the output value by factor and the input tensor contains the expected values of corresponding output points. For example, a factor of 0.1 means that 10 events are needed to increase the output value by 1, while a factor of 10 means that a single event increases the output by 10. The output values are quantized to multiples of factor. The larger the factor, the more noise is present in the output. A factor of 0 makes this an identity operation.

The shape and data type of the output will match the input.

Supported backends
  • ‘cpu’

  • ‘gpu’

Parameters

input (TensorList) – Input to the operator.

Keyword Arguments
  • bytes_per_sample_hint (int or list of int, optional, default = [0]) –

    Output size hint, in bytes per sample.

    If specified, the operator’s outputs residing in GPU or page-locked host memory will be preallocated to accommodate a batch of samples of this size.

  • factor (float or TensorList of float, optional, default = 20.0) – Factor parameter.

  • preserve (bool, optional, default = False) – Prevents the operator from being removed from the graph even if its outputs are not used.

  • seed (int, optional, default = -1) –

    Random seed.

    If not provided, it will be populated based on the global seed of the pipeline.