randn

The ‘af.randn()’ function in the ArrayFire library is used to generate arrays filled with random numbers drawn from a normal (Gaussian) distribution with mean 0 and standard deviation 1. This is useful in statistical simulations, machine learning, and other applications where normally distributed random values are required.

Function

af.python()
  • Python interface to form an array filled with numbers.

Detailed Description

The ‘af.randn()’ function creates an ArrayFire array where each element is a random number sampled from a standard normal distribution, also known as a Gaussian distribution. The distribution has a mean of 0 and a standard deviation of 1. This function allows you to specify the dimensions of the array and optionally the data type. By default, the function generates numbers in single precision floating-point format (float), but other data types can be specified if needed.

Function Documentation