nvidia.dali.fn.random.beta#

nvidia.dali.fn.random.beta(__shape_like=None, /, *, alpha=1.0, beta=1.0, bytes_per_sample_hint=[0], dtype=None, preserve=False, seed=-1, shape=None, device=None, name=None)#

Generates a random number from [0, 1] range following the beta distribution.

The beta distribution has the following probabilty distribution function:

\[f(x) = \frac{\Gamma(\alpha + \beta)}{\Gamma(\alpha)\Gamma(\beta)} x^{\alpha-1} (1-x)^{\beta-1}\]

where Г is the gamma function defined as:

\[\Gamma(\alpha) = \int_0^\infty x^{\alpha-1} e^{-x} \, dx\]

The operator supports float32 and float64 output types.

The shape of the generated data can be either specified explicitly with a shape argument, or chosen to match the shape of the __shape_like input, if provided. If none are present, a single value per sample is generated.

Supported backends
  • ‘cpu’

Parameters:

__shape_like (TensorList, optional) – Shape of this input will be used to infer the shape of the output, if provided.

Keyword Arguments:
  • alpha (float or TensorList of float, optional, default = 1.0) – The alpha parameter, a positive float32 scalar.

  • beta (float or TensorList of float, optional, default = 1.0) – The beta parameter, a positive float32 scalar.

  • 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.

  • dtype (nvidia.dali.types.DALIDataType, optional) –

    Output data type.

    Note

    The generated numbers are converted to the output data type, rounding and clamping if necessary.

  • 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.

  • shape (int or list of int or TensorList of int, optional) – Shape of the output data.