torch_normal | R Documentation |
Normal
Normal distributed
torch_normal(mean, std, size = NULL, generator = NULL, ...)
mean |
(tensor or scalar double) Mean of the normal distribution.
If this is a |
std |
(tensor or scalar double) The standard deviation of the normal
distribution. If this is a |
size |
(integers, optional) only used if both |
generator |
a random number generator created with |
... |
Tensor option parameters like |
Returns a tensor of random numbers drawn from separate normal distributions whose mean and standard deviation are given.
The mean
is a tensor with the mean of
each output element's normal distribution
The std
is a tensor with the standard deviation of
each output element's normal distribution
The shapes of mean
and std
don't need to match, but the
total number of elements in each tensor need to be the same.
Similar to the function above, but the means are shared among all drawn elements.
Similar to the function above, but the standard-deviations are shared among all drawn elements.
Similar to the function above, but the means and standard deviations are shared
among all drawn elements. The resulting tensor has size given by size
.
When the shapes do not match, the shape of mean
is used as the shape for the returned output tensor
if (torch_is_installed()) {
torch_normal(mean=0, std=torch_arange(1, 0, -0.1) + 1e-6)
torch_normal(mean=0.5, std=torch_arange(1., 6.))
torch_normal(mean=torch_arange(1., 6.))
torch_normal(2, 3, size=c(1, 4))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.