Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


torch (version 0.3.0)

torch_poisson: Poisson

Description

Poisson

Usage

torch_poisson(self, generator = NULL)

Arguments

self

(Tensor) the input tensor containing the rates of the Poisson distribution

generator

(torch.Generator, optional) a pseudorandom number generator for sampling

poisson(input *, generator=NULL) -> Tensor

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 i.e.,

outiPoisson(inputi)

Examples

Run this code
# NOT RUN {
if (torch_is_installed()) {

rates = torch_rand(c(4, 4)) * 5  # rate parameter between 0 and 5
torch_poisson(rates)
}
# }

Run the code above in your browser using DataLab