V
- data type for output()
output@Operator(group="random") public final class RandomPoisson<V extends Number> extends PrimitiveOp implements Operand<V>
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
Modifier and Type | Class and Description |
---|---|
static class |
RandomPoisson.Options
Optional attributes for
RandomPoisson |
operation
Modifier and Type | Method and Description |
---|---|
Output<V> |
asOutput()
Returns the symbolic handle of a tensor.
|
static <V extends Number,T extends Number,U extends Number> |
create(Scope scope,
Operand<T> shape,
Operand<U> rate,
Class<V> dtype,
RandomPoisson.Options... options)
Factory method to create a class wrapping a new RandomPoisson operation.
|
static <T extends Number,U extends Number> |
create(Scope scope,
Operand<T> shape,
Operand<U> rate,
RandomPoisson.Options... options)
Factory method to create a class wrapping a new RandomPoisson operation using default output types.
|
Output<V> |
output()
A tensor with shape `shape + shape(rate)`.
|
static RandomPoisson.Options |
seed(Long seed) |
static RandomPoisson.Options |
seed2(Long seed2) |
equals, hashCode, op, toString
public static <V extends Number,T extends Number,U extends Number> RandomPoisson<V> create(Scope scope, Operand<T> shape, Operand<U> rate, Class<V> dtype, RandomPoisson.Options... options)
scope
- current scopeshape
- 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.dtype
- options
- carries optional attributes valuespublic static <T extends Number,U extends Number> RandomPoisson<Long> create(Scope scope, Operand<T> shape, Operand<U> rate, RandomPoisson.Options... options)
scope
- current scopeshape
- 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.options
- carries optional attributes valuespublic static RandomPoisson.Options seed(Long seed)
seed
- If either `seed` or `seed2` are set to be non-zero, the random number
generator is seeded by the given seed. Otherwise, it is seeded by a
random seed.public static RandomPoisson.Options seed2(Long seed2)
seed2
- A second seed to avoid seed collision.public Output<V> output()
public Output<V> asOutput()
Operand
Inputs to TensorFlow operations are outputs of another TensorFlow operation. This method is used to obtain a symbolic handle that represents the computation of the input.
asOutput
in interface Operand<V extends Number>
OperationBuilder.addInput(Output)
Copyright © 2022. All rights reserved.