PyTorch Random Number Generation Quiz
60 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Match the following functions with their descriptions:

randn_like = Returns a tensor with the same size as input that is filled with random numbers from a normal distribution with mean 0 and variance 1. randperm = Returns a random permutation of integers from 0 to n - 1. torch.Tensor.bernoulli_() = In-place version of torch.bernoulli() torch.Tensor.cauchy_() = Numbers drawn from the Cauchy distribution

Match the following functions with their descriptions:

torch.Tensor.exponential_() = Numbers drawn from the exponential distribution torch.Tensor.geometric_() = Elements drawn from the geometric distribution torch.Tensor.log_normal_() = Samples from the log-normal distribution torch.Tensor.normal_() = In-place version of torch.normal()

Match the following functions with their descriptions:

torch.Tensor.random_() = Numbers sampled from the discrete uniform distribution torch.Tensor.uniform_() = Numbers sampled from the continuous uniform distribution quasirandom.SobolEngine = An engine for generating (scrambled) Sobol sequences torch.bernoulli() = An out-of-place version of torch.Tensor.bernoulli_()

Match the following functions with their descriptions:

<p>torch.cauchy() = An out-of-place version of torch.Tensor.cauchy_() torch.exponential() = An out-of-place version of torch.Tensor.exponential_() torch.geometric() = An out-of-place version of torch.Tensor.geometric_() torch.log_normal() = An out-of-place version of torch.Tensor.log_normal_()</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>torch.normal() = An out-of-place version of torch.Tensor.normal_() torch.random() = An out-of-place version of torch.Tensor.random_() torch.uniform() = An out-of-place version of torch.Tensor.uniform_() torch.quasirandom() = An out-of-place version of quasirandom.SobolEngine</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>randn_like = Returns a tensor with the same size as input that is filled with random numbers from a normal distribution with mean 0 and variance 1. randperm = Returns a random permutation of integers from 0 to n - 1. torch.Tensor.bernoulli_() = In-place version of torch.bernoulli() torch.Tensor.cauchy_() = Numbers drawn from the Cauchy distribution</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>torch.Tensor.exponential_() = Numbers drawn from the exponential distribution torch.Tensor.geometric_() = Elements drawn from the geometric distribution torch.Tensor.log_normal_() = Samples from the log-normal distribution torch.Tensor.normal_() = In-place version of torch.normal()</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>torch.Tensor.random_() = Numbers sampled from the discrete uniform distribution torch.Tensor.uniform_() = Numbers sampled from the continuous uniform distribution quasirandom.SobolEngine = An engine for generating (scrambled) Sobol sequences torch.bernoulli() = An out-of-place version of torch.Tensor.bernoulli_()</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>torch.cauchy() = An out-of-place version of torch.Tensor.cauchy_() torch.exponential() = An out-of-place version of torch.Tensor.exponential_() torch.geometric() = An out-of-place version of torch.Tensor.geometric_() torch.log_normal() = An out-of-place version of torch.Tensor.log_normal_()</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>torch.normal() = An out-of-place version of torch.Tensor.normal_() torch.random() = An out-of-place version of torch.Tensor.random_() torch.uniform() = An out-of-place version of torch.Tensor.uniform_() torch.quasirandom() = An out-of-place version of quasirandom.SobolEngine</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>manual_seed = Sets the seed for generating random numbers get_rng_state = Returns the random number generator state as a torch.ByteTensor set_rng_state = Sets the random number generator state bernoulli = Draws binary random numbers (0 or 1) from a Bernoulli distribution</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>multinomial = Returns a tensor where each row contains num_samples indices sampled from the multinomial probability distribution located in the corresponding row of tensor input normal = Returns a tensor of random numbers drawn from separate normal distributions whose mean and standard deviation are given poisson = Returns a tensor of the same size as input with each element sampled from a Poisson distribution with rate parameter given by the corresponding element in input rand = Returns a tensor filled with random numbers from a uniform distribution on the interval $[ 0 , 1 )$</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>rand_like = Returns a tensor with the same size as input that is filled with random numbers from a uniform distribution on the interval $[ 0 , 1 )$ randint = Returns a tensor filled with random integers generated uniformly between low (inclusive) and high (exclusive) randint_like = Returns a tensor with the same shape as Tensor input filled with random integers generated uniformly between low (inclusive) and high (exclusive) randn = Returns a tensor filled with random numbers from a normal distribution with mean 0 and variance 1 (also called the standard normal distribution)</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>manual_seed = Sets the seed for generating random numbers torch.default_generator = Returns the default CPU torch.Generator bernoulli = Draws binary random numbers (0 or 1) from a Bernoulli distribution poisson = Returns a tensor of the same size as input with each element sampled from a Poisson distribution with rate parameter given by the corresponding element in input</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>rand_like = Returns a tensor with the same size as input that is filled with random numbers from a uniform distribution on the interval $[ 0 , 1 )$ randint_like = Returns a tensor with the same shape as Tensor input filled with random integers generated uniformly between low (inclusive) and high (exclusive) normal = Returns a tensor of random numbers drawn from separate normal distributions whose mean and standard deviation are given rand = Returns a tensor filled with random numbers from a uniform distribution on the interval $[ 0 , 1 )$</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>manual_seed = Sets the seed for generating random numbers get_rng_state = Returns the random number generator state as a torch.ByteTensor set_rng_state = Sets the random number generator state multinomial = Returns a tensor where each row contains num_samples indices sampled from the multinomial probability distribution located in the corresponding row of tensor input</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>randn = Returns a tensor filled with random numbers from a normal distribution with mean 0 and variance 1 (also called the standard normal distribution) randint = Returns a tensor filled with random integers generated uniformly between low (inclusive) and high (exclusive) poisson = Returns a tensor of the same size as input with each element sampled from a Poisson distribution with rate parameter given by the corresponding element in input bernoulli = Draws binary random numbers (0 or 1) from a Bernoulli distribution</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>torch.default_generator = Returns the default CPU torch.Generator normal = Returns a tensor of random numbers drawn from separate normal distributions whose mean and standard deviation are given randint_like = Returns a tensor with the same shape as Tensor input filled with random integers generated uniformly between low (inclusive) and high (exclusive) rand_like = Returns a tensor with the same size as input that is filled with random numbers from a uniform distribution on the interval $[ 0 , 1 )$</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>randn = Returns a tensor filled with random numbers from a normal distribution with mean 0 and variance 1 (also called the standard normal distribution) randint = Returns a tensor filled with random integers generated uniformly between low (inclusive) and high (exclusive) multinomial = Returns a tensor where each row contains num_samples indices sampled from the multinomial probability distribution located in the corresponding row of tensor input get_rng_state = Returns the random number generator state as a torch.ByteTensor</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>set_rng_state = Sets the random number generator state bernoulli = Draws binary random numbers (0 or 1) from a Bernoulli distribution poisson = Returns a tensor of the same size as input with each element sampled from a Poisson distribution with rate parameter given by the corresponding element in input torch.default_generator = Returns the default CPU torch.Generator</p> Signup and view all the answers

Match the following Torch functions with their descriptions:

<p>randn_like = Returns a tensor with the same size as input that is filled with random numbers from a normal distribution with mean 0 and variance 1 randperm = Returns a random permutation of integers from 0 to n - 1 torch.Tensor.bernoulli_() = In-place version of torch.bernoulli() torch.Tensor.cauchy_() = Numbers drawn from the Cauchy distribution</p> Signup and view all the answers

Match the following in-place random sampling functions with their descriptions:

<p>torch.Tensor.exponential_() = Numbers drawn from the exponential distribution torch.Tensor.geometric_() = Elements drawn from the geometric distribution torch.Tensor.log_normal_() = Samples from the log-normal distribution torch.Tensor.normal_() = In-place version of torch.normal()</p> Signup and view all the answers

Match the following Torch functions with their descriptions:

<p>torch.Tensor.random_() = Numbers sampled from the discrete uniform distribution torch.Tensor.uniform_() = Numbers sampled from the continuous uniform distribution quasirandom.SobolEngine = An engine for generating (scrambled) Sobol sequences torch.Tensor.bernoulli_() = In-place version of torch.bernoulli()</p> Signup and view all the answers

Match the following Torch functions with their descriptions:

<p>torch.Tensor.cauchy_() = Numbers drawn from the Cauchy distribution torch.Tensor.exponential_() = Numbers drawn from the exponential distribution torch.Tensor.geometric_() = Elements drawn from the geometric distribution torch.Tensor.log_normal_() = Samples from the log-normal distribution</p> Signup and view all the answers

Match the following Torch functions with their descriptions:

<p>torch.Tensor.normal_() = In-place version of torch.normal() torch.Tensor.random_() = Numbers sampled from the discrete uniform distribution torch.Tensor.uniform_() = Numbers sampled from the continuous uniform distribution quasirandom.SobolEngine = An engine for generating (scrambled) Sobol sequences</p> Signup and view all the answers

Match the following Torch functions with their descriptions:

<p>randn_like = Returns a tensor with the same size as input that is filled with random numbers from a normal distribution with mean 0 and variance 1 randperm = Returns a random permutation of integers from 0 to n - 1 torch.Tensor.bernoulli_() = In-place version of torch.bernoulli() torch.Tensor.cauchy_() = Numbers drawn from the Cauchy distribution</p> Signup and view all the answers

Match the following in-place random sampling functions with their descriptions:

<p>torch.Tensor.exponential_() = Numbers drawn from the exponential distribution torch.Tensor.geometric_() = Elements drawn from the geometric distribution torch.Tensor.log_normal_() = Samples from the log-normal distribution torch.Tensor.normal_() = In-place version of torch.normal()</p> Signup and view all the answers

Match the following Torch functions with their descriptions:

<p>torch.Tensor.random_() = Numbers sampled from the discrete uniform distribution torch.Tensor.uniform_() = Numbers sampled from the continuous uniform distribution quasirandom.SobolEngine = An engine for generating (scrambled) Sobol sequences torch.Tensor.bernoulli_() = In-place version of torch.bernoulli()</p> Signup and view all the answers

Match the following Torch functions with their descriptions:

<p>torch.Tensor.cauchy_() = Numbers drawn from the Cauchy distribution torch.Tensor.exponential_() = Numbers drawn from the exponential distribution torch.Tensor.geometric_() = Elements drawn from the geometric distribution torch.Tensor.log_normal_() = Samples from the log-normal distribution</p> Signup and view all the answers

Match the following Torch functions with their descriptions:

<p>torch.Tensor.normal_() = In-place version of torch.normal() torch.Tensor.random_() = Numbers sampled from the discrete uniform distribution torch.Tensor.uniform_() = Numbers sampled from the continuous uniform distribution quasirandom.SobolEngine = An engine for generating (scrambled) Sobol sequences</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>manual_seed = Sets the seed for generating random numbers get_rng_state = Returns the random number generator state as a torch.ByteTensor bernoulli = Draws binary random numbers (0 or 1) from a Bernoulli distribution randint = Returns a tensor filled with random integers generated uniformly between low (inclusive) and high (exclusive)</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>rand_like = Returns a tensor with the same size as input that is filled with random numbers from a uniform distribution on the interval $[0,1)$ poisson = Returns a tensor of the same size as input with each element sampled from a Poisson distribution with rate parameter given by the corresponding element in input normal = Returns a tensor of random numbers drawn from separate normal distributions whose mean and standard deviation are given multinomial = Returns a tensor where each row contains num_samples indices sampled from the multinomial probability distribution located in the corresponding row of tensor input</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>randn = Returns a tensor filled with random numbers from a normal distribution with mean 0 and variance 1 (also called the standard normal distribution) randint_like = Returns a tensor with the same shape as Tensor input filled with random integers generated uniformly between low (inclusive) and high (exclusive) torch.default_generator = Returns the default CPU torch.Generator set_rng_state = Sets the random number generator state</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>rand = Returns a tensor filled with random numbers from a uniform distribution on the interval $[0,1)$ initial_seed = Returns the initial seed for generating random numbers as a Python long random sampling seed = Sets the seed for generating random numbers to a non-deterministic random number bernoulli = Draws binary random numbers (0 or 1) from a Bernoulli distribution</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>manual_seed = Sets the seed for generating random numbers normal = Returns a tensor of random numbers drawn from separate normal distributions whose mean and standard deviation are given randint_like = Returns a tensor with the same shape as Tensor input filled with random integers generated uniformly between low (inclusive) and high (exclusive) rand_like = Returns a tensor with the same size as input that is filled with random numbers from a uniform distribution on the interval $[0,1)$</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>poisson = Returns a tensor of the same size as input with each element sampled from a Poisson distribution with rate parameter given by the corresponding element in input randn = Returns a tensor filled with random numbers from a normal distribution with mean 0 and variance 1 (also called the standard normal distribution) multinomial = Returns a tensor where each row contains num_samples indices sampled from the multinomial probability distribution located in the corresponding row of tensor input torch.default_generator = Returns the default CPU torch.Generator</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>set_rng_state = Sets the random number generator state initial_seed = Returns the initial seed for generating random numbers as a Python long rand = Returns a tensor filled with random numbers from a uniform distribution on the interval $[0,1)$ get_rng_state = Returns the random number generator state as a torch.ByteTensor</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>bernoulli = Draws binary random numbers (0 or 1) from a Bernoulli distribution randint = Returns a tensor filled with random integers generated uniformly between low (inclusive) and high (exclusive) random sampling seed = Sets the seed for generating random numbers to a non-deterministic random number manual_seed = Sets the seed for generating random numbers</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>randint_like = Returns a tensor with the same shape as Tensor input filled with random integers generated uniformly between low (inclusive) and high (exclusive) normal = Returns a tensor of random numbers drawn from separate normal distributions whose mean and standard deviation are given poisson = Returns a tensor of the same size as input with each element sampled from a Poisson distribution with rate parameter given by the corresponding element in input multinomial = Returns a tensor where each row contains num_samples indices sampled from the multinomial probability distribution located in the corresponding row of tensor input</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>rand_like = Returns a tensor with the same size as input that is filled with random numbers from a uniform distribution on the interval $[0,1)$ torch.default_generator = Returns the default CPU torch.Generator set_rng_state = Sets the random number generator state randn = Returns a tensor filled with random numbers from a normal distribution with mean 0 and variance 1 (also called the standard normal distribution)</p> Signup and view all the answers

Match the following in-place random sampling functions with their descriptions:

<p>torch.Tensor.bernoulli_() = In-place version of torch.bernoulli() torch.Tensor.cauchy_() = Numbers drawn from the Cauchy distribution torch.Tensor.exponential_() = Numbers drawn from the exponential distribution torch.Tensor.geometric_() = Elements drawn from the geometric distribution</p> Signup and view all the answers

Match the following in-place random sampling functions with their descriptions:

<p>torch.Tensor.log_normal_() = Samples from the log-normal distribution torch.Tensor.normal_() = In-place version of torch.normal() torch.Tensor.random_() = Numbers sampled from the discrete uniform distribution torch.Tensor.uniform_() = Numbers sampled from the continuous uniform distribution</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>randn_like = Returns a tensor with the same size as input that is filled with random numbers from a normal distribution with mean 0 and variance 1. randperm = Returns a random permutation of integers from 0 to n - 1. torch.Tensor.bernoulli_() = In-place version of torch.bernoulli() torch.Tensor.cauchy_() = Numbers drawn from the Cauchy distribution</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>torch.Tensor.exponential_() = Numbers drawn from the exponential distribution torch.Tensor.geometric_() = Elements drawn from the geometric distribution torch.Tensor.log_normal_() = Samples from the log-normal distribution torch.Tensor.normal_() = In-place version of torch.normal()</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>torch.Tensor.random_() = Numbers sampled from the discrete uniform distribution torch.Tensor.uniform_() = Numbers sampled from the continuous uniform distribution quasirandom.SobolEngine = An engine for generating (scrambled) Sobol sequences randn_like = Returns a tensor with the same size as input that is filled with random numbers from a normal distribution with mean 0 and variance 1.</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>randperm = Returns a random permutation of integers from 0 to n - 1. torch.Tensor.bernoulli_() = In-place version of torch.bernoulli() torch.Tensor.cauchy_() = Numbers drawn from the Cauchy distribution torch.Tensor.exponential_() = Numbers drawn from the exponential distribution</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>torch.Tensor.geometric_() = Elements drawn from the geometric distribution torch.Tensor.log_normal_() = Samples from the log-normal distribution torch.Tensor.normal_() = In-place version of torch.normal() torch.Tensor.random_() = Numbers sampled from the discrete uniform distribution</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>torch.Tensor.uniform_() = Numbers sampled from the continuous uniform distribution quasirandom.SobolEngine = An engine for generating (scrambled) Sobol sequences randn_like = Returns a tensor with the same size as input that is filled with random numbers from a normal distribution with mean 0 and variance 1. randperm = Returns a random permutation of integers from 0 to n - 1.</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>torch.Tensor.bernoulli_() = In-place version of torch.bernoulli() torch.Tensor.cauchy_() = Numbers drawn from the Cauchy distribution torch.Tensor.exponential_() = Numbers drawn from the exponential distribution torch.Tensor.geometric_() = Elements drawn from the geometric distribution</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>torch.Tensor.log_normal_() = Samples from the log-normal distribution torch.Tensor.normal_() = In-place version of torch.normal() torch.Tensor.random_() = Numbers sampled from the discrete uniform distribution torch.Tensor.uniform_() = Numbers sampled from the continuous uniform distribution</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>manual_seed = Sets the seed for generating random numbers get_rng_state = Returns the random number generator state as a torch.ByteTensor bernoulli = Draws binary random numbers (0 or 1) from a Bernoulli distribution normal = Returns a tensor of random numbers drawn from separate normal distributions whose mean and standard deviation are given</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>poisson = Returns a tensor of the same size as input with each element sampled from a Poisson distribution rand = Returns a tensor filled with random numbers from a uniform distribution on the interval $[0 , 1)$ randint = Returns a tensor filled with random integers generated uniformly between low (inclusive) and high (exclusive) randn = Returns a tensor filled with random numbers from a normal distribution with mean 0 and variance 1</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>randint_like = Returns a tensor with the same shape as Tensor input filled with random integers generated uniformly between low (inclusive) and high (exclusive) rand_like = Returns a tensor with the same size as input that is filled with random numbers from a uniform distribution on the interval $[0 , 1)$ set_rng_state = Sets the random number generator state initial_seed = Returns the initial seed for generating random numbers as a Python long</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>torch.default_generator = Returns the default CPU torch.Generator multinomial = Returns a tensor where each row contains num_samples indices sampled from the multinomial probability distribution located in the corresponding row of tensor input manual_seed = Sets the seed for generating random numbers get_rng_state = Returns the random number generator state as a torch.ByteTensor</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>bernoulli = Draws binary random numbers (0 or 1) from a Bernoulli distribution normal = Returns a tensor of random numbers drawn from separate normal distributions whose mean and standard deviation are given poisson = Returns a tensor of the same size as input with each element sampled from a Poisson distribution rand = Returns a tensor filled with random numbers from a uniform distribution on the interval $[0 , 1)$</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>randint = Returns a tensor filled with random integers generated uniformly between low (inclusive) and high (exclusive) randn = Returns a tensor filled with random numbers from a normal distribution with mean 0 and variance 1 randint_like = Returns a tensor with the same shape as Tensor input filled with random integers generated uniformly between low (inclusive) and high (exclusive) rand_like = Returns a tensor with the same size as input that is filled with random numbers from a uniform distribution on the interval $[0 , 1)$</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>set_rng_state = Sets the random number generator state initial_seed = Returns the initial seed for generating random numbers as a Python long torch.default_generator = Returns the default CPU torch.Generator multinomial = Returns a tensor where each row contains num_samples indices sampled from the multinomial probability distribution located in the corresponding row of tensor input</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>manual_seed = Sets the seed for generating random numbers get_rng_state = Returns the random number generator state as a torch.ByteTensor bernoulli = Draws binary random numbers (0 or 1) from a Bernoulli distribution normal = Returns a tensor of random numbers drawn from separate normal distributions whose mean and standard deviation are given</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>poisson = Returns a tensor of the same size as input with each element sampled from a Poisson distribution rand = Returns a tensor filled with random numbers from a uniform distribution on the interval $[0 , 1)$ randint = Returns a tensor filled with random integers generated uniformly between low (inclusive) and high (exclusive) randn = Returns a tensor filled with random numbers from a normal distribution with mean 0 and variance 1</p> Signup and view all the answers

Match the following functions with their descriptions:

<p>randint_like = Returns a tensor with the same shape as Tensor input filled with random integers generated uniformly between low (inclusive) and high (exclusive) rand_like = Returns a tensor with the same size as input that is filled with random numbers from a uniform distribution on the interval $[0 , 1)$ set_rng_state = Sets the random number generator state initial_seed = Returns the initial seed for generating random numbers as a Python long</p> Signup and view all the answers

More Like This

PyTorch
15 questions

PyTorch

HumourousBowenite avatar
HumourousBowenite
PyTorch Torch APIs
42 questions

PyTorch Torch APIs

HumourousBowenite avatar
HumourousBowenite
Use Quizgecko on...
Browser
Browser