Poisson
Source:R/gen-namespace-docs.R
, R/gen-namespace-examples.R
, R/gen-namespace.R
torch_poisson.Rd
Poisson
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.,
Examples
if (torch_is_installed()) {
rates = torch_rand(c(4, 4)) * 5 # rate parameter between 0 and 5
torch_poisson(rates)
}
#> torch_tensor
#> 0 2 0 0
#> 1 1 0 0
#> 0 6 0 3
#> 2 8 6 0
#> [ CPUFloatType{4,4} ]