RandomPoisson
tensorflow C++ API
tensorflow::ops::RandomPoisson
Outputs random values from the Poisson distribution(s) described by rate.
Summary
This op uses two algorithms, depending on rate. If rate >= 10, then the algorithm by Hormann is used to acquire samples via transformation-rejection. See http://www.sciencedirect.com/science/article/pii/0167668793909974.
Otherwise, Knuth's algorithm is used to acquire samples via multiplying uniform random variables. See Donald E. Knuth (1969). Seminumerical Algorithms. The Art of Computer Programming, Volume 2. Addison Wesley
Arguments:
- scope: A Scope object
- shape: 1-D integer tensor. Shape of independent samples to draw from each distribution described by the shape parameters given in rate.
- rate: A tensor in which each scalar is a "rate" parameter describing the associated poisson distribution.
Optional attributes (see Attrs
):
- seed: If either
seed
orseed2
are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed. - seed2: A second seed to avoid seed collision.
Returns:
Output
: A tensor with shapeshape + shape(rate)
. Each slice[:, ..., :, i0, i1, ...iN]
contains the samples drawn forrate[i0, i1, ...iN]
. The dtype of the output matches the dtype of rate.
RandomPoisson block
Source link : https://github.com/EXPNUNI/enuSpaceTensorflow/blob/master/enuSpaceTensorflow/tf_random.cpp
Argument:
- Scope scope : A Scope object (A scope is generated automatically each page. A scope is not connected.)
- Input shape: connect Input node.
- Input rate: connect Input node.
- RandomPoisson ::Attrs attrs : Input attrs in value. ex) seed_ = 0;seed2_ = 0;
Return:
- Output output : Output object of RandomPoisson class object.
Result:
- std::vector(Tensor) product_result : Returned object of executed result by calling session.